Echo form info?

Associate
Joined
1 Oct 2004
Posts
793
Location
Windsor
Hi guys,

How would I go about echoing some form information on a page I am currently redirecting too?

Currently I have some php code which sends a form to my database - these variables are - '$first','$last','$house','$road','$code','$phone','$purch','$comment' - once these have been sent the code then redirects the user to a "thanks" page.

Is it possible to have the sent variables echoed onto the thanks page, if so how would I go about doing it with php?

Thanks
 
I usually debug forms in PHP using print_r($_REQUEST), which outputs the entire POST+GET array's, or seperatly print_r $_GET and $_POST.
Theres an extension for Firefox that displays all the data you send in a CGI form which is quite useful.
 
How are you doing the redirect?

If it's a header redirect you could do

Code:
header("Location: http://www.example.com/thankyou.php?first=$first'&last=$last&house=$house&road=$road&code=$code&phone=$phone&purch=$purch&comment=$comment");

Bit messy though, maybe you could do $mysql_insert_id=mysql_insert_id(); and then pass that over header("Location: http://www.example.com/thankyou.php?i=$mysql_insert_id") and the just do a $_GET["i"]; on the thankyou page.

Obviously $_GET isn't secure as it could be changed to extract other peoples details, so maybe a setting a session variable would be a better option.
 
Back
Top Bottom