Darren, We're not really set up to do line-by-line debugging. You may need to spend a bit (more) time learning PHP to avoid these sorts of frustrations.
When the code is executed it gives a parse error on the line containing value=\"$value">". It would have been helpful to have pointed us at that line and told us the error msg (cf "now the next line gets an error"). The problem is that the last set of (internal) double-quotes are not 'escaped' and consequently PHP thinks they terminate the string to be printed. Otherwise everything seems to be fine. Regards, =dn ----- Original Message ----- From: "Darren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 04 November 2001 22:24 Subject: Re: [PHP-DB] Function Prolem parse error > Jason, > > Thanks alot! now the next line gets an error. > > The original code was as follows > > $output = <<<EOQ > <input type="hidden" name="$name" value="$value"> > EOQ; > return $output; > > Then I changed it to > > $output = print("<input type=\"hidden\" name=\"$name\" > value=\"$value">"); > > return $output; > > I did this so the code would be compatible with php3 instead of php4 > (what the code was originaly written for. > > Thanks for the help, Jason, Dl, and Paul, and anybody else that is > keeping up with the thread. > > Darren > > Jason Wong wrote: > > > On Monday 05 November 2001 04:45, Darren wrote: > > > > [snip] > > > > > >>// string hidden_field ([string name [, string value]]) > >> > >>// This function returns an HTML hidden field. A value may be > >>supplied. > >> > >>function hidden_field ($name="", $value="") > >>{ > >> $output = print("<input type=\"hidden\" name=\"$name\" > >>value=\"$value">"); > >> > >> return $output; > >>} > >> > >>I still don't understand what the fix should be or what is wrong. > >> > > > > You can just define that function as: > > > > function hidden_field($name, $value) { > > blah... > > blah... > > } > > > > hth > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]