COpy of forms PHP MYSQL

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
petenyce105
Forum Newbie
Posts: 4
Joined: Wed Feb 11, 2004 9:52 am

COpy of forms PHP MYSQL

Post 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?
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Re: COpy of forms PHP MYSQL

Post 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 )
petenyce105
Forum Newbie
Posts: 4
Joined: Wed Feb 11, 2004 9:52 am

almost there

Post 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?
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Re: almost there

Post 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?
petenyce105
Forum Newbie
Posts: 4
Joined: Wed Feb 11, 2004 9:52 am

almost there

Post 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?
User avatar
dimitris
Forum Contributor
Posts: 110
Joined: Wed Jan 14, 2004 3:47 am
Location: Athens, Greece

Re: almost there

Post 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
Post Reply