OpenStudy (bgrg007):

HELP with php/html! i have a textbox in page1.php page. I type "hello" in it, and when i click the submit button, page2.php page appears and has the word, "hello". But when i return to is returned to page1.php, "hello" is no more on textbox. It is blank. Then, when I come back to page2.php, it is blank as well. So, my question is how can I save my text values in both pages?

2 years ago
OpenStudy (e.mccormick):

Are you using the back button or some button on the page?

2 years ago
OpenStudy (bgrg007):

the first page has an edit button that takes me to the second page. second page has the submit button. i just click between these buttons to go back and forth. second page has a text box where i write stuff.

2 years ago
OpenStudy (bgrg007):

echo "<textarea name = box value = " . $_POST['box'] . "> </textarea>"; The line is above is from page 2. $text1 = $_POST["box"]; echo $text1; The two lines above are from page 1.

2 years ago
OpenStudy (e.mccormick):

Basically, to get things from one page to the next needs some sort of form. However, for it to go backwards it also needs a form. So the first page has to be made to take in data from the second and the second from the first. This keeps the data alive as toyu click on buttons, tabs, etc. In client side scripting there are some other things you can do, but for server side scripting you are limited.

2 years ago
OpenStudy (bgrg007):

yea, i added the forms where the 'form action' of the first page is the second page and for the second page, its the first.

2 years ago
OpenStudy (e.mccormick):

Did you put in a conditional test to make sure the first page only sets the form value to nothing if it is not getting called by the second page?

2 years ago
OpenStudy (bgrg007):

no, but if i did so, does that also lead to text values being saved?

2 years ago
OpenStudy (e.mccormick):

Well, it is more about them not being cleared when you go to the first page. I am not sure what you are doing to initialize the value to nothing. But also not sure how much that is needed. I am not PHP skilled, so working form basi programming principals and what I remember from some perl-cgi forms I did work with before.

2 years ago
OpenStudy (woodrow73):

You could mess with sessions.. getting creative with that could definitely yield the result you're looking for.

2 years ago
Similar Questions: