[PHP] little problem with ' and stuff
hi there, i'm having a small problem, wondering if anybody can help // a line in my script defining $url $url = $directory . '/main.php?id=' . $id; // a line later on in the frameset calling this $url echo 'frame name=main scrolling=no src='$url''; this gives me a paring error on the last line any suggestions?? thanks michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] little problem with ' and stuff
At 09:27 10-2-2003, you wrote: hi there, i'm having a small problem, wondering if anybody can help // a line in my script defining $url $url = $directory . '/main.php?id=' . $id; // a line later on in the frameset calling this $url echo 'frame name=main scrolling=no src='$url''; this gives me a paring error on the last line please get yourself a strong pot of coffee and spend some time reading the manual, in this case http://www.php.net/manual/en/language.types.string.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] little problem with ' and stuff
At 09:46 10.02.2003, Chris Hayes said: [snip] At 09:27 10-2-2003, you wrote: hi there, i'm having a small problem, wondering if anybody can help // a line in my script defining $url $url = $directory . '/main.php?id=' . $id; // a line later on in the frameset calling this $url echo 'frame name=main scrolling=no src='$url''; this gives me a paring error on the last line please get yourself a strong pot of coffee and spend some time reading the manual, in this case http://www.php.net/manual/en/language.types.string.php [snip] To shorten up the process, you're missing the string concatenizer: echo 'frame name=main scrolling=no src=' . $url . ''; or echo 'frame name=main scrolling=no src=', $url, ''; This doesn't mean you shouldn't read the manual, though *twinkle* -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] little problem with ' and stuff
Hi, On Mon, 10 Feb 2003 09:27:38 +0100 Michiel van Heusden [EMAIL PROTECTED] wrote: hi there, i'm having a small problem, wondering if anybody can help // a line in my script defining $url $url = $directory . '/main.php?id=' . $id; // a line later on in the frameset calling this $url echo 'frame name=main scrolling=no src='$url''; I believe the correct format is: echo 'frame name=main scrolling=no src='.$url.''; Note the dots! HTH, Florin. this gives me a paring error on the last line any suggestions?? thanks michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Florin Dumitrescu Webmaster Departamentul Internet Astral Telecom SA, Sucursala Brasov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] little problem with ' and stuff
Michael -- ...and then Michiel van Heusden said... % % hi there, Hi! % % i'm having a small problem, wondering if anybody can help ... % echo 'frame name=main scrolling=no src='$url''; You've already seen the suggestions to . together your parts, so I needn't suggest that. I wonder why on earth you're bothering, though! If you use ' then you will, indeed, need to . the $variables into the string, but if you use then you can just include them with the rest of your output. Your incorrect echo 'frame name=main scrolling=no src='$url''; instead of having to become echo 'frame name=main scrolling=no src=' . $url . ''; is simply echo frame name='main' scrolling='no' src='$url'; and away you go... I, too, have wondered why pretty much everyone on this list writes their html as tag field=data rather than using perfectly valid single quotes and making their lives easier... In perl you can use *any* char as your quoting character and so you even have it both ways! HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg96399/pgp0.pgp Description: PGP signature