Hey, just a quick question about the following code:

<input name='name' type='text' class='form' value='<?php echo "" . (isset($_REQUEST['name'])) ? dataClean(ex_clean($_REQUEST['name'])) : FALSE . "";?>' size="40" rows='5' />

Now, if the user has errors in the form details and clicks submit, the page refreshes and it displays what errors need fixing, but it keeps the data that the user filled in.

Can anyone tell me how to go about adding a peice of code to this to make it so that it will keep the data with a regular page refresh?

I got some help with this the other day, but can't figure out how to do it with the PHP being used here.

Any ideas?

Basically I was the form to stay with all the inputs filled in after a regular page refresh. I know there's alot of help with this floating around but I couldn't find anything specific enough.

Any help appreciated

Recommended Answers

All 3 Replies

Are you looking for the ability to stop entering part way thru filling the form, refresh the page and whatever you entered has been retained? If so, then you need to look into some javascript to save the values as soon as you complete each field.

Are you looking for the ability to stop entering part way thru filling the form, refresh the page and whatever you entered has been retained? If so, then you need to look into some javascript to save the values as soon as you complete each field.

Thanks for the reply. Yeaph pretty much. I was just wondering if there was a way to do it with PHP using the example I gave. Any way to do this with PHP?

Thanks for the reply. Yeaph pretty much.

I actualy decided to search this site for any people with the same problem [should have done it before, i know] but I came across this:

<input type='text' name='name' value=<?php echo $_REQUEST['name']; ?>>

I may give something like this a try.

Anyone know how I could get something like this to work along side the other code I have? Tried it, but nothing seems to work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.