saving input of php form and restore

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sanjay1236
Forum Newbie
Posts: 1
Joined: Mon Feb 23, 2015 8:05 am

saving input of php form and restore

Post by sanjay1236 »

Hello am new to php

have two forms main.php and another is submain.php
in main.php input fields are different that of submain.php
enters all fields of main.php
calls submain.php in submit button of main.php
do something in submain.php and after click to backtomain i comes back to main.php
but I founds whatever I entered earlier becomes blank
how can I solve this problem
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: saving input of php form and restore

Post by Celauran »

First step is probably to post some code so we can see what's going on.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: saving input of php form and restore

Post by Celauran »

I don't see any mention of SQLite in the OP.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: saving input of php form and restore

Post by Christopher »

sanjay1236 wrote:do something in submain.php and after click to backtomain i comes back to main.php
but I founds whatever I entered earlier becomes blank
how can I solve this problem
You need to maintain the values. Two common ways to do this. The first, and simplest, is to pass values in hidden fields to maintain all field values between forms. The second way is save the values in the session.
(#10850)
sky2002
Forum Newbie
Posts: 4
Joined: Mon Feb 16, 2015 9:24 pm

Re: saving input of php form and restore

Post by sky2002 »

I think you can use historyback with javascript
Post Reply