Page 1 of 1

COpy of forms PHP MYSQL

Posted: Wed Feb 11, 2004 9:52 am
by petenyce105
I have a form that user submits via php to a mysql database. Now how owuld i show online a copy of the form that the user submitted for his or her records? So when the user submits the form into the database then a user can check back online and see a copy of their form they submited? ANy way to do this?

Re: COpy of forms PHP MYSQL

Posted: Wed Feb 11, 2004 10:39 am
by dimitris
petenyce105 wrote:I have a form that user submits via php to a mysql database. Now how owuld i show online a copy of the form that the user submitted for his or her records? So when the user submits the form into the database then a user can check back online and see a copy of their form they submited? ANy way to do this?
When a form is submitted you pass your values with a post action!So when you are at the next page or the same (if you submitted them on the same page) then you still have all the values e.g. name,email etc etc.
So you can still use them: e.g.
Somewhere in your php code write:

Code: Select all

$name=$HTTP_POST_VARSї'name'];//you've just collected the value of name textfield
and somewhere in the HTML code edit the textfield :

Code: Select all

<input name="name" value="<?php echo $name ?>" type="text" id="name" value="name" size="20">
This works if you want to use that values in the exact following page. Otherwise you should resent them via POST or GET actions or try $_SESSION variables (first,try some session tutorials! :D )

almost there

Posted: Wed Feb 11, 2004 10:50 am
by petenyce105
now the cod eu gave will show results on the thnak you page i have. now if i wanted to show the results on a recent submission page how can i start this. so if user submits 6 referrals they will be able to view on a web page in some kind of format the forms they submitted?

Re: almost there

Posted: Wed Feb 11, 2004 11:54 am
by dimitris
petenyce105 wrote:now the cod eu gave will show results on the thnak you page i have. now if i wanted to show the results on a recent submission page how can i start this. so if user submits 6 referrals they will be able to view on a web page in some kind of format the forms they submitted?
What do you mean?You want to store these information until the user requests them again?

almost there

Posted: Wed Feb 11, 2004 11:58 am
by petenyce105
well the user submits the form then they want to see the form at a later time? So if they submit a form with information and they want to go online at a later tiem to verfy the information they can go to a web page i create and it will show them the form they created like a history page?

Re: almost there

Posted: Wed Feb 11, 2004 12:11 pm
by dimitris
petenyce105 wrote:well the user submits the form then they want to see the form at a later time? So if they submit a form with information and they want to go online at a later tiem to verfy the information they can go to a web page i create and it will show them the form they created like a history page?
Then you should store this values in session variables!
Go on and find a session tutorial in order to understand them!Then ask me back!
Try this:http://www.phpfreaks.com/tutorials/41/0.php