Jump to content

Recommended Posts

Hello there !

I'm sending a big a form to be stored in DDBB, after storing the user is headed by header(location:"whatever.php") to a wellcoming page, but whenever is an error on the mysql query and datas can't be stored on DDBB, I would like the user to be sended back to the form page and to find all the fields already filled by reusing the $_POST[] vars.

Is it possible? Can $_post[] array be re-sended?

Sessions are stored on a file on the server. It can hold massive amounts of data without worry. Plus it is all text, I take it, and text holds no space at all.

 

You can store it in the session as an array or as individual vars, it is up to you.

you just need some better error handling.

 

only have the user redirected upon a successful database query.

 

if the query is a success, redirect...if not, back to the form they go.

 

will save all that other unnecessary business.

oh, and in your form input fields be sure to have something like this...

 

<input type="text" name="whatever" value="<?php echo $_POST['something']; ?>" />

 

that way, when the user is back at the form, any inputted values will be present in the input field's.

 

you can do textarea as well.

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.