PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 4th, 1999, 06:59 PM
AlexDG
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi! I donno what I've found but I can't solve it.

<form method="post" action="1.php3">
<input type="text" name="test" value="<? echo $test ?>">
<input type="submit">
</form>


If I type any characters like ', , " (which usually displays in the code like ', , ") and submit a form, all those characters are getting replaced by ', and ".

example:

' > submit form
result: ' > submit again
result: ' > submit again
result: '

does anyone have/had such a problem?

Thank you

Reply With Quote
  #2  
Old December 5th, 1999, 08:24 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You must have magic quotes on. You can either turn them off (see manual) or change this line:

<input type="text" name="test" value="<? echo $test ?>">

to this:

<input type="text" name="test" value="<? echo stripslashes($test) ?>">

Reply With Quote
  #3  
Old December 5th, 1999, 09:22 AM
AlexDG
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thank a lot man!! =)

Reply With Quote
  #4  
Old December 5th, 1999, 09:37 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Ooops, I made a mistake. If a " exists in $test, then the value will not parse right as HTML will interpret that " as the closing " of value.

You need to do one more operation:

<input type="text" name="test" value="<? echo htmlspecialchars(stripslashes($test)) ?>">

htmlspecialchars() converts &,",<,> to &,",>,&lt respectively so it will display properly.


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > possible BUG???

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap