Jump to content


Very Specific Magic Quotes Question

  • Please log in to reply
1 reply to this topic

#1 mikeschuld

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 12 May 2006 - 07:30 PM

I am writing a tab manager for my site that essentially has a textarea for code input and a textbox for the tab title and the scripts auto add tabs and their panels to be shown and hidden. My problem is that when I enter php code into the textarea (or html for that matter) my quotes are being \" because of magic quotes.

This would not normally be that much of a problem, since I can just turn off magic quotes, but some of the php I have is also needing those quotes (ex. print("some random stuff \"kicks\" butt."); ) to be kept in there, and they are converted back to the normal quote character essentially breaking the php and not allowing the tab to run all the way.

I wrote my own stripslashes to go in and replace certain quotes that I know will be incorrectly converted, but I just can't seem to get them all to work all the time. Is there any solution for this that you know of?

#2 hvle

  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 13 May 2006 - 01:28 AM

take a look at addslashes(), stripslashes(), addcslashes(), stripsslashes() in the php function manual.

Life's too short for arguing.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users