Jump to content

Easy Question


N-Bomb(Nerd)

Recommended Posts

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?  ;D

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.