Jump to content

Recommended Posts

I'm not sure if this is a php problem or not but here goes.

I have an online program that consists of four php pages.

Each page takes you to the next after your data is entered or selected until you get to the fourth page.

That is where you get the final solution needed. The main reason I separated the pages was for looks so there wasn't too much to view or do on any one page. The problem is when you get to the last page & you enter all your data you can't change any selections from the previous page without losing all the data you just entered on the last page. There are about 50 different input boxes on that page too. The only thing I can think to do is to combine all the pages into one to solve the problem but that defeats my original purpose of separating the pages to begin with.

Here's the link -  http://www.loadcalc.net 

Any ideas welcome   

Link to comment
https://forums.phpfreaks.com/topic/263930-keeping-data-when-changing-php-page/
Share on other sites

Use sessions to repopulate the input fields with the stored value in the session.

 

<input type="text" name="" id="" value="$_SESSION['session_name']" />

 

When each page is submitted assign the $_POST to a session, and don't unset the sessions until all the data is finally submitted.

You need to look at creating multiple boxes one being a "Save" button as opposed to "Save and Continue" or something like that. This way, the user can save the page and go backwards or forwards.

 

Use a session to maintain the data whilst the user fills out the form as FilmMaker already suggested. I would unset that session once everything is complete as well.

Thanks to everyone for the ideas,

 

I'm going to read up on all these recommendations & see how things work.

My programming skills are pretty weak. I'm just learning what I need to do on an as needed basis.

Probably not the best way to do it but thank God for the internet.

You need to look at creating multiple boxes one being a "Save" button as opposed to "Save and Continue" or something like that. This way, the user can save the page and go backwards or forwards.

 

Use a session to maintain the data whilst the user fills out the form as FilmMaker already suggested. I would unset that session once everything is complete as well.

 

Right now I'm using:

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

to keep the data in the fields when the page is submitted.

Wouldn't I have to still use the php tags to use $_SESSION ?

 

 

 

 

 

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.