madspof Posted August 30, 2007 Share Posted August 30, 2007 Hi I am trying to place a dynamic src url for an image in a echo function, but I think the reason the script is not working is because of the amount of quotation mark in the echo function. Here is the code i am try to insert it to: echo "<IMG SRC='{$row['url']}' ALT='Starflower'> <br><br><br>"; Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/ Share on other sites More sharing options...
BlueSkyIS Posted August 30, 2007 Share Posted August 30, 2007 No. Put this before that line and see yourself: $row['url'] = "test"; $row['url'] must be empty if you're not seeing anything there. Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337981 Share on other sites More sharing options...
darkfreaks Posted August 30, 2007 Share Posted August 30, 2007 Try echo "<IMG SRC='$row['url']' ALT='Starflower'> <br><br><br>"; Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337984 Share on other sites More sharing options...
BlueSkyIS Posted August 30, 2007 Share Posted August 30, 2007 ^^ THAT will not work. Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337986 Share on other sites More sharing options...
madspof Posted August 30, 2007 Author Share Posted August 30, 2007 I tested all those options and they did not work but i cannot sem to get it to work correctly. Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337987 Share on other sites More sharing options...
madspof Posted August 30, 2007 Author Share Posted August 30, 2007 I tried using the concatenation operator to enter the url in but with no luck Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337993 Share on other sites More sharing options...
darkfreaks Posted August 30, 2007 Share Posted August 30, 2007 <?php echo "<IMG SRC=\"".$row['url']."\ ALT="Starflower"> <br><br><br>";?> Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-337999 Share on other sites More sharing options...
Jessica Posted August 30, 2007 Share Posted August 30, 2007 <?php echo "<IMG SRC=\"".$row['url']."\ ALT="Starflower"> <br><br><br>";?> Close, but not quite. Try: <?php echo '<IMG SRC="'.$row['url'].' ALT="Starflower"> <br><br><br>';?> Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-338034 Share on other sites More sharing options...
darkfreaks Posted August 30, 2007 Share Posted August 30, 2007 lol i just tried to escape it thanks. Quote Link to comment https://forums.phpfreaks.com/topic/67366-variables-whithin-a-string-is-there-too-many-quotation-marks/#findComment-338036 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.