Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

form help

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

form help

Postby kat » Tue Nov 26, 2002 8:35 pm

I have an html form that will pass data to a php file that will update my mysql database. It works fine but I want to first have a confirmation page so they can check there info before they submit it. My question is how can I get the variables to the third page. I know how to pass then from the first to the second:


//firstpage.php
<form method = "post" action = "secondpage.php">

first_name
last_name
etc
</form>


Like I said I know how to get them from the first to the second page

//secondpage.php

$firstname = _POST['first_name'];
$lastname = _POST['last_name'];
ect

now in the secondpage.php I just print out what they put in the form to confirm but I would like to know how to pass the variables with info (first_name, last_name etc) into the thirdpage.php. so I can actually update the database (which I know how to do ).

Thank you
kat
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Nov 25, 2002 8:14 pm

Postby Elena Mitovska » Tue Nov 26, 2002 11:17 pm

The easiest way to pass variables to third page, is to pass them using form on second page.

If you don't want variables values to be edited on second page, so user can only look at what he entered, you can output variables in <input> element with readonly=true and style="border:0 none transparent". So it wil not be seen that variables are shown in input, but will seem that words are simply printed on page, and user wil not be able to change data because of "readonly=true". If you don't want to show values of some variableson second page, but need them retrived on third page, store their values in <input type="hidden"> on second page.

Then just specify yuor third file as action for this form on second page, and receive variable on third page the same way as you received them on second page.
Elena Mitovska
New php-forum User
New php-forum User
 
Posts: 13
Joined: Tue Nov 12, 2002 12:11 pm
Location: Ukraine


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.