LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2008, 11:30 AM   #1
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Rep: Reputation: 15
Posting html & PHP. Getting unwanted / when using " in text box.


Hi,

I have a simple form:


Quote:
<FORM METHOD="POST" ACTION="myscript.php">

Speech Box input:

<INPUT TYPE="text" NAME="mytext" SIZE="50">

<INPUT TYPE="submit">
<INPUT TYPE="reset">

and a simple php script:

Quote:
<?PHP

$filename = "mytext.txt";
$text = $_POST['mytext']; #

$fp = fopen ($filename, "w");
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
echo ("File written");
}
else {
echo ("File was not written");
}

?>
If I input:

Quote:
I am "very" cold.
I get:

Quote:
I am \"very\" cold.
in the resulting txt file.

Can someone tell me what is causing this?

Thanks,
-OG-
 
Old 03-02-2008, 01:20 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
http://us3.php.net/manual/en/ref.inf...gic-quotes-gpc
 
Old 03-03-2008, 09:32 AM   #3
OldGaf
Member
 
Registered: Feb 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Thanks for you help. I turned off the "Magic" stuff in the php.ini and all is good!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtaining check box value in PHP/HTML woodpecka_04 Programming 3 07-11-2007 01:52 PM
"Out the box" security of Apache, PHP and MySQL on FC6 lostjohnny Linux - Security 3 05-09-2007 04:15 AM
"Search this forum" text box maxfacta LQ Suggestions & Feedback 6 08-01-2005 12:27 AM
How to "Search & Replace" in html files using Perl? rebel Red Hat 8 04-09-2005 12:58 PM
how can I seprate normal text from html tags spell check it & then again place it ins amit_28oct Programming 5 08-07-2004 07:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration