Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Dl and everybody else,

Thank you all for your help and patience.


Dl Neil wrote:

 > 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.

O.K.


Meanwhile ..




Dl Neil wrote:

> Darren,
> 

> 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").
> 


I'll do my best to inform everybody of the error.  In this case it 
was the same parse error as the other.


> 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.


I was comparing a similar line earlier in the code and it looked 
fine to me. But I'm still learning


I tryed it and I got the same error

The code I used

$output = print("");

return $output;


Thanks

Darren



-- 
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]




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread DL Neil

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;
> return $output;
>
> Then I changed it to
>
> $output = print(" 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(" >>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]




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Jason,

Thanks alot! now the next line gets an error.

The original code was as follows

$output = <<
EOQ;
return $output;

Then I changed it to

$output = print("");

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(">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]




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Jason Wong

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(" 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
-- 
Jason Wong
Gremlins Associates
www.gremlins.com.hk

-- 
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]




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread Darren

Dl,

Thanks for the input an the link to the manuels, there are very 
helpful.  I have looked at them but I don't understand what default 
variables has to do with the listed code.  To give you a better idea 
(if you need it you may not) I'll put a little more of code in for 
context purposes.

// 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("");

return $output;
}

I still don't understand what the fix should be or what is wrong.

Thanks for the help

Darren

Dl Neil wrote:

>>Paul if your there I have another issue similar to the past.  It is 
>>probably a PHP3 to PHP4 problem.
>>
>>Here tis
>>
>>function hidden_field ($name="", $value="")
>>
>>*
>>I have no clue what could be wrong.
>>
> 
> 
> Darren,
> 
> Check out http://uk.php.net/manual/en/functions.php and from there look up "Default 
>Argument Values".
> 
> =dn
> 
> 


-- 
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]




Re: [PHP-DB] Function Prolem parse error

2001-11-04 Thread DL Neil

> Paul if your there I have another issue similar to the past.  It is 
> probably a PHP3 to PHP4 problem.
> 
> Here tis
> 
> function hidden_field ($name="", $value="")
> 
> *
> I have no clue what could be wrong.


Darren,

Check out http://uk.php.net/manual/en/functions.php and from there look up "Default 
Argument Values".

=dn


-- 
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]