[SOLVED] how do i echo quotes and double quotes from the add

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwaynek
Forum Newbie
Posts: 2
Joined: Sat Oct 23, 2004 7:53 am

[SOLVED] how do i echo quotes and double quotes from the add

Post by dwaynek »

nigma | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

hi I'm using php to echo a variable retrieved from the address bar as a url but everytime i have a quote or double quote, when i echo the contents, there's always a \ (backslash) before the quote or doublequote. 

anyone know an easy fix to this?

to highlight what I'm trying to do, here's the bit of code that displays the variable.

Code: Select all

<p align="center"><font color="#FF00FF" size="+2"><strong>
<?php echo $msg; ?></strong></font></p>
http://www.test.com/realecard.php?msg=hello%22and%27

for some reason, this is coming out as

hello''and\"

rather than

hello'and"

any ideas?

nigma | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

[php_man]stripslashes[/php_man]

Code: Select all

<?php
$msg = stripslashes($_GET['msg']);
echo $msg;
?>
dwaynek
Forum Newbie
Posts: 2
Joined: Sat Oct 23, 2004 7:53 am

Post by dwaynek »

you are sooooo da man! thanks!
Post Reply