N-Bomb(Nerd) Posted February 25, 2010 Share Posted February 25, 2010 I haven't messed with PHP in a long time.. but a friend asked for a project and I'm nearly complete.. just stumped on one thing. I'm trying to make a registration page for his website, and using post to self validate on my own form.. however I'm trying to replace any validated values back into their text field.. I'm trying to figure out the best way to make the input safe enough to put back into the text field.. but still have their original value? Like I said it's been a long time since I've done anything like this and I've totally forgot.. basically just looking for a secure way of putting a value back into it's field. Ideas/Suggestions? Quote Link to comment Share on other sites More sharing options...
PugJr Posted February 25, 2010 Share Posted February 25, 2010 A cookie? Quote Link to comment Share on other sites More sharing options...
N-Bomb(Nerd) Posted February 25, 2010 Author Share Posted February 25, 2010 A cookie? I suppose a cookie would be a way to store the value, however that isn't exactly what I'm needing. I have a registration form I'm making and people are able to put in code into the text fields and break my form and insert whatever code they want. I'm looking for a way to stop that from happening.. Quote Link to comment Share on other sites More sharing options...
N-Bomb(Nerd) Posted March 1, 2010 Author Share Posted March 1, 2010 Bump. Quote Link to comment Share on other sites More sharing options...
Deoctor Posted March 1, 2010 Share Posted March 1, 2010 what do u mean by the code.. try using the htmlspecialchars() while fetching the data from the form.. even they enter the code it will get fetched to u in what ever way they have entered.. check these other articles also... http://php.net/manual/en/function.htmlentities.php http://www.php.net/manual/en/function.htmlspecialchars.php http://www.php.net/manual/en/function.strip-tags.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.