Log In
Sign Up
Why Join Hot Scripts?
Hot Scripts
All Categories
PHP
Python
Tools & Utilities
XML
Ruby on Rails
Ajax
Web Hosting
ASP
ASP.NET
C & C++
CFML
Flash
Java
JavaScript
CGI & Perl
HTML5
Forums
Blog
Scripts
Hosted Apps
Plugins
Design Templates
Forum
Blog
Advertise
Contact Us
Register
FAQ
Rules
Calendar
Search
Today's Posts
Mark Forums Read
RSS Feeds
Current location:
Hot Scripts Forums
»
Programming Languages
»
PHP
» Why I always get \' and \" after I submit the form !
Why I always get \' and \" after I submit the form !
LinkBack
Thread Tools
Display Modes
#
1
(
permalink
)
07-12-03, 05:14 PM
kevin
Newbie Coder
Join Date: Jun 2003
Location: USA
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Why I always get \' and \" after I submit the form !
Hello !
I have a textbox + area textbox in my form
Each time I submit the form - if I write something like
I'm a boy
I said "Hello"
then the result on next page become like this
I\\'m a boy
I said \"Hello\"
How to get rid off the thing \
Thanks
kevin
View Public Profile
Find all posts by kevin
#
2
(
permalink
)
07-12-03, 06:00 PM
Man Down
HS Staff
Join Date: Jun 2003
Location: Maryland
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:
stripslashes("I\'m a boy");
__________________
Man Down
Man Down
View Public Profile
Find all posts by Man Down
#
3
(
permalink
)
07-13-03, 03:03 AM
Stefan
Junior Code Guru
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
or in this case: stripslashes($_POST['textarea'])
or whatever your textarea is called.
__________________
Stefan
's
websites
:
Electronic Music World
,
Fantasylibrary.net
,
.php Techlog
,
WebSight Directory System
Stefan
View Public Profile
Visit Stefan's homepage!
Find all posts by Stefan
#
4
(
permalink
)
07-13-03, 11:00 AM
alesh.ru
Internet-paraSITE
Join Date: Jul 2003
Location: Moscow, Russia
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
i prefer to use this code:
PHP Code:
foreach(
$_POST
as
$k
=>
$v
){
$k
=
striptslashes
(
$_POST
[
$v
]);
}
This code is more secure.
__________________
From Russia with love
alesh.ru
View Public Profile
Visit alesh.ru's homepage!
Find all posts by alesh.ru
#
5
(
permalink
)
11-24-03, 04:57 AM
fyrestrtr
Wannabe Coder
Join Date: Nov 2003
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
Alesh.ru : How is it more secure? You are generating variables -- trusting the user not to enter malicious data. That's not secure.
Kevin : The reason it is automatically escaping your data is because you have magic_quotes_gpc turned on in your php.ini file. See
http://www.php.net/manual/en/functio...quotes-gpc.php
and
http://www.php.net/manual/en/ref.inf...gic-quotes-gpc
for more information
fyrestrtr
View Public Profile
Visit fyrestrtr's homepage!
Find all posts by fyrestrtr
Bookmarks
Digg
del.icio.us
StumbleUpon
Google
«
webform not sending data to DB
|
Any Code For Pulling Out MySQL Port?
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
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
Trackbacks
are
On
Pingbacks
are
On
Refbacks
are
On
Forum Rules
Forum Jump
User Control Panel
Private Messages
Subscriptions
Who's Online
Search Forums
Forums Home
General Community
Announcements
Polls
The Lounge
New Members & Introductions
Script Requests
HotScripts.com Discussion
Hot Scripts Forum Questions, Suggestions and Feedback
General HotScripts Site Discussion
HotScripts Site Bug Reports
General Web Coding
HTML/XHTML/XML
HTML5
JavaScript
CSS
Flash & ActionScript
Programming Languages
PHP
Perl
ASP
ASP.NET
C/C++
Visual Basic
Windows .NET Programming
Everything Java
Other Languages
Other Discussions
Web Servers
Database
Other Topics
Web Design
API
Frameworks
AJAX
Security
Server Administration
Portable Device Programming
Cloud Computing
Ruby on Rails
CFML
Python
Tools and Utilities
Remotely Hosted
Web Hosting
Advertising Forums
General Advertisements
Job Offers & Assistance
Traffic Exchange
Website Reviews
Web Hosting Talk
DBForums.com
All times are GMT -5. The time now is
10:27 AM
.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
LinkBack
LinkBack URL
About LinkBacks
Bookmark & Share
Digg this Thread!
Add Thread to del.icio.us
Bookmark in Technorati
Share on Facebook
Share on Stumble Upon
Share on Twitter