\" whats this all about??

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

digitalbloke
New php-forum User
New php-forum User
Posts: 59
Joined: Tue Jul 01, 2003 7:02 am

\" whats this all about??

Postby digitalbloke » Fri Aug 01, 2003 9:45 am

Hi i have made a script to edit pages but every time i save it puts \ infront of " and ' how do i stop this?



Thanks

User avatar
Virtuoso
php-forum Active User
php-forum Active User
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am
Contact:

Postby Virtuoso » Fri Aug 01, 2003 10:49 am

everytime you save?
as in you put stuff in a form and save it?
it has something to do with magicquotes i think. i think there is a function to turn it off.

digitalbloke
New php-forum User
New php-forum User
Posts: 59
Joined: Tue Jul 01, 2003 7:02 am

Postby digitalbloke » Fri Aug 01, 2003 11:00 am

yeah when i type code for a page

eg:

Code: Select all

<?
$name = "digitalbloke"
?>


comes out as

Code: Select all

>?
$name = \"digitalbloke\"
?>

Joel
New php-forum User
New php-forum User
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand
Contact:

Postby Joel » Fri Aug 01, 2003 1:59 pm

stripslashes($string)

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Sat Aug 02, 2003 9:57 am

are you using addslashes()??
If not have a look at this:
http://php.net/manual/en/ref.info.php#i ... quotes-gpc

reinheitphp
New php-forum User
New php-forum User
Posts: 12
Joined: Sun Jul 13, 2003 10:58 pm
Contact:

Postby reinheitphp » Sun Aug 03, 2003 12:19 am

Code: Select all

<?
$name = "digitalbloke";
?>

put a simicolon

striping slashes would be good for a form if you type quotes in it or else it will write slashes by them in the result

other quote stuff
if you are going to echo something that has quotes such as HTML put slashes in it or else it gets confused with the quotes around echo...

Code: Select all

echo"<a href=\"blahblah.com\">fdfdf</a>";

//or you can use a singal quote without slashes
echo"<a href='blahblah.com'>fdfdf</a>";

//or you can switch the quotes around
echo'<a href="blahblah.com">fdfdf</a>';

other wise it will put slashes in the result

Joel
New php-forum User
New php-forum User
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand
Contact:

Postby Joel » Sun Aug 03, 2003 12:36 am

I think what digitalbloke is saying, is that he has made a page which has a form on it, which loads into the form text box the page he wants to edit.

The simple stripslashes will remove the slashes when saving the file.

Adding a semi-colon will do nothing as there is only one line of PHP code.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 5 guests