alienmojo Posted January 8, 2007 Share Posted January 8, 2007 $accountnum=$row['accountnum'];echo '<center>';echo '<a href="descrip.php?accountnum=$accountnum">';im trying to send a varible through to descrip.php. instead of sending the value of $accountnum is sending the physical sting "$accountnum" im not sure how to fix this Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/ Share on other sites More sharing options...
trq Posted January 8, 2007 Share Posted January 8, 2007 [code=php:0]echo "<a href='descrip.php?accountnum=$accountnum'>";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155385 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 Or, if you prefer to use double quoted HTML attributes like the XHTML specs say:echo '<a href="descrip.php?accountnum='.$accountnum.'">'; Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155387 Share on other sites More sharing options...
trq Posted January 8, 2007 Share Posted January 8, 2007 [quote]Or, if you prefer to use double quoted HTML attributes like the XHTML specs say[/quote]Funnily enough, there is nothing in the specs that says you must use double quotes. I thought so for a long time aswell. Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155393 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 [quote author=thorpe link=topic=121437.msg499349#msg499349 date=1168216952][quote]Or, if you prefer to use double quoted HTML attributes like the XHTML specs say[/quote]Funnily enough, there is nothing in the specs that says you must use double quotes. I thought so for a long time aswell.[/quote]http://www.w3.org/TR/xhtml1/#h-4.4I looked it up just the other day. I said XHTML. It might not be in HTML, but w3 urges to use XHTML now. Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155396 Share on other sites More sharing options...
trq Posted January 8, 2007 Share Posted January 8, 2007 Nowhere does that mention double vs single quotes. Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155402 Share on other sites More sharing options...
scott212 Posted January 8, 2007 Share Posted January 8, 2007 $accountnum=$row['accountnum'];echo '<center>';echo "<a href=\"descrip.php?accountnum=$accountnum\">";As with Perl, I'm pretty sure php does variable interpolation within double quotes and remains verbatim with single quotes. In this case it would be just as easy to stay with double quotes on your last statement and escape the inner html qoutes. Your $accountnum will still be replaced. Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155418 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 [quote author=thorpe link=topic=121437.msg499358#msg499358 date=1168217439]Nowhere does that mention double vs single quotes.[/quote]Ah, you're right...I saw it somewhere...*head explodes* Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155421 Share on other sites More sharing options...
trq Posted January 8, 2007 Share Posted January 8, 2007 I thought Id'e seen it somewhere too, but have since never found any reference toward it. Quote Link to comment https://forums.phpfreaks.com/topic/33270-solved-sending-varibles/#findComment-155425 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.