473,387 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Input text issues

Pol
Whenever I receive input from an HTML text field or and HTML text area
with " or ' meaning double or singe quotes into a php variable and
then print or echo it back out to the user in html I get these
characters accompanies by a \ . Why is this and how can I get rid of it.
$submitform->body=@$_POST['body']; <<<< there are no \ in the input.

print("body - ".$submitform->body."<br>"); <<<< but here there will
be slashes for all ' or " .

Thanks for any help!
Feb 27 '06 #1
4 1894
I believe php is 'escaping' these characters so they will not be parsed as
code.

see http://us3.php.net/manual/en/function.stripslashes.php

hth
nan

"Pol" <Po*@nospam.com> wrote in message
news:12*************@news.supernews.com...
Whenever I receive input from an HTML text field or and HTML text area
with " or ' meaning double or singe quotes into a php variable and then
print or echo it back out to the user in html I get these characters
accompanies by a \ . Why is this and how can I get rid of it.
$submitform->body=@$_POST['body']; <<<< there are no \ in the input.

print("body - ".$submitform->body."<br>"); <<<< but here there will be
slashes for all ' or " .

Thanks for any help!

Feb 27 '06 #2
Andy Hassall has a better answer under the previous post "Weird: Slashes
getting added"
"Nancy" <no@email.due.to.spam.com> wrote in message
news:AV*****************@newsread1.news.atl.earthl ink.net...
I believe php is 'escaping' these characters so they will not be parsed as
code.

see http://us3.php.net/manual/en/function.stripslashes.php

hth
nan

"Pol" <Po*@nospam.com> wrote in message
news:12*************@news.supernews.com...
Whenever I receive input from an HTML text field or and HTML text area
with " or ' meaning double or singe quotes into a php variable and then
print or echo it back out to the user in html I get these characters
accompanies by a \ . Why is this and how can I get rid of it.
$submitform->body=@$_POST['body']; <<<< there are no \ in the input.

print("body - ".$submitform->body."<br>"); <<<< but here there will be
slashes for all ' or " .

Thanks for any help!


Feb 27 '06 #3
Pol wrote:
Whenever I receive input from an HTML text field or and HTML text area
with " or ' meaning double or singe quotes into a php variable and
then print or echo it back out to the user in html I get these
characters accompanies by a \ . Why is this and how can I get rid of it.
$submitform->body=@$_POST['body']; <<<< there are no \ in the input.

print("body - ".$submitform->body."<br>"); <<<< but here there will
be slashes for all ' or " .

Thanks for any help!


Pol,

I believe this was asked and answered in this same ng less than an hour ago.

see
http://groups.google.com/group/comp....4215579cd1dd4e

Carl.
Feb 27 '06 #4
hi friend,

Please try to user stripeslashes this will remove slashes and gives you
data as u had enterd.

Feb 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Eduard Dewolf | last post by:
Hi, Im have been changing my site to make it HTML 4.01 compliant As I should, I wrapped all INPUT tags in blocks I wrapped the not visible INPUT type HIDDEN tags in first PRE, later H6 tags...
5
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS....
5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
2
by: Andrew Chanter | last post by:
I am developing my first ADP client for a SQL db, after having used mdb's as clients in numerous applications previously. I have found that theoretically the Input Parameters property of a form in...
1
by: Csaba Gabor | last post by:
Short version: if the user types an alt+ctrl+char combination which leads to a defined character, but s/he's not in a input(text)/textarea, then I'd like that keystroke combination to do the same...
10
by: sbaker8688 | last post by:
My God, how on earth do you use javacript to change the text color of an input element, and have it work with IE??? I've tried numerous solutions. All of them work on browsers such as Mozilla. ...
2
by: =?Utf-8?B?ZGxpbmdn?= | last post by:
I have a simple c# windows form with a textbox and button that, when clicked, displays a simple MessageBox. With the cursor in the textbox, I can select the Japanese language and desired Input...
5
by: Jeff | last post by:
I needed to to do a quick width set for form input type="text", So: input{ width: 200px; } That also styled all my radio buttons!
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.