|
-
Apr 15th, 2002, 03:59 PM
#1
Thread Starter
Stuck in the 80s
Write to file?
I have a simple form on my page that contains a textarea. I am saving the text in this textarea to a specified file in an input field. The problem is that when the text is saved to the file, it adds '\' before characters like quotes (single and double) and other things. How can I prevent this?
Last edited by The Hobo; Apr 15th, 2002 at 04:32 PM.
-
Apr 15th, 2002, 04:06 PM
#2
add
$variable = htmlspecialchars($variable)
and / or make sure the magic_quotes_gpc is on in php.ini file.
-
Apr 15th, 2002, 04:33 PM
#3
Thread Starter
Stuck in the 80s
With that code, the file contents end up looking like this:
<pre style=\"background:#F4F4F4;\"><!-- WARNING: This tag is required to maintain spacing! --><font color=\"#008800\">\'Coded by Kristopher Wilson \'http://www.mindlessdrone.com/ \' [email protected] \' \'Create a form with two command buttons and drop \'in the following code to see how to use the FlashWindow \'API </font> <font color=\"#000088\">Private Declare Function </font>FlashWindowEx <font color=\"#000088\">Lib </font>\"user32\" _ (pfwi <font color=\"#000088\">As </font>FLASHWINFO) <font color=\"#000088\">As Boolean </font> <font color=\"#000088\">Private </font>Type FLASHWINFO cbSize <font color=\"#000088\">As Long </font> hwnd <font color=\"#000088\">As Long </font> dwFlags <font color=\"#000088\">As Long </font> uCount <font color=\"#000088\">As Long </font> dwTimeout <font color=\"#000088\">As Long End </font>Type <font color=\"#000088\">Const </font>FLASHW_STOP = 0 <font color=\"#000088\">Const </font>FLASHW_CAPTION = &H1 <font color=\"#000088\">Const </font>FLASHW_TRAY = &H2 <font color=\"#000088\">Const </font>FLASHW_ALL = (FLASHW_CAPTION <font color=\"#000088\">Or </font>FLASHW_TRAY) <font color=\"#000088\">Const </font>FLASHW_TIMER = &H4 <font color=\"#000088\">Const </font>FLASHW_TIMERNOFG = &HC <font color=\"#000088\">Dim </font>flshWindow <font color=\"#000088\">As </font>FLASHWINFO <font color=\"#000088\">Private Sub </font>Command1_Click() <font color=\"#000088\">With </font>flshWindow .cbSize = Len(flshWindow) .dwFlags = FLASHW_ALL <font color=\"#000088\">Or </font>FLASHW_TIMER .dwTimeout = 0 .hwnd = Me.hwnd .uCount = 0 <font color=\"#000088\">End With </font> FlashWindowEx flshWindow <font color=\"#000088\">End Sub </font> <font color=\"#000088\">Private Sub </font>Command2_Click() flshWindow.dwFlags = FLASHW_STOP FlashWindowEx flshWindow <font color=\"#000088\">End Sub </font></pre>
-
Apr 15th, 2002, 04:34 PM
#4
Thread Starter
Stuck in the 80s
Is there a way I can just strip the '\' characters out of it?
-
Apr 15th, 2002, 04:57 PM
#5
Originally posted by scoutt
make sure the magic_quotes_gpc is on in php.ini file.
-
Apr 15th, 2002, 05:02 PM
#6
PowerPoster
Try passing it through the stripslashes() function
-
Apr 15th, 2002, 05:10 PM
#7
Thread Starter
Stuck in the 80s
Originally posted by scoutt
make sure the magic_quotes_gpc is on in php.ini file.
If I knew where the php.ini file was, maybe...
-
Apr 15th, 2002, 05:12 PM
#8
Thread Starter
Stuck in the 80s
Originally posted by chrisjk
Try passing it through the stripslashes() function
You da man Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|