Re: Problem with passing variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27 Jan 2004 at 15:56, Ricardo Lopes wrote:

> If you have something like this:
> 
> echo '<td><a href="email.php?recip=$myrow[0]"><img src="graphics/mail.gif"
> class="imglink" alt="Click to send mail to this person" /></a></td></tr>';
> 
> It wont work. Use instead:
> 
> echo '<td><a href="email.php?recip='.$myrow[0].'"><img
> src="graphics/mail.gif" class="imglink" alt="Click to send mail to this
> person" /></a></td></tr>';
> 
> Notice the '. before the $myrow[0] and the .' after, any doubt see the
> documentation about operators.
> 
> This is caused because the ' doesnt parse variables to values like the "
> does.
> 

Ricardo - That's it!  I did read a lot of PHP docs and mailing list posts before I posted my 
question to this list, but never stumbled (and that's the word, I'm afraid!) on the syntax 
explanation that would untangle this for me.

If I want to pass additional variables for processing on the second page, I'm assuming 
that the syntax would be (where $foo is another variable)

<a href="email.php?foo='.$myrow[3].'&?recip='.$myrow[0].' ">

Thanks again for restoring my sanity!

Cheers --- Phil Matt


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux