Re: Problem with passing variables
| From: | Phil Matt | Date: | Tue, 27 Jan 2004 16:27:06 +0000 |
| Subject: | Re: Problem with passing variables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32639@lists.php.net to get a copy of this message | ||
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