Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html form processing

Status
Not open for further replies.

rtikeith

Technical User
Sep 16, 2002
24
US
I have a form that I want to send the results of to a second webpage for the user to view before the results are sent to me via email. The problem is I don't know how to send the results to a second webpage for viewing before submitting it. I want to avoid using JavaScript because it can be disabled. I would rather use php or run a script to achieve this.

Thanks for your help in advance.
 
that would depend upon the language you use....

ASP: request.Form("fieldName")
CF: Just use the field name like a variable....

[conehead]
 
I could use php and I am not familiar with asp.

I would rather use a prewritten script that I could edit if there is a free or cheap one out there.
 
I am not familiar with PHP but grabbing a form value is just a basic... on your second page just grab the value from the form (using the field name) and assign it to a variable and then display that variable... that's all... no real cookie-cutter script for something like that... if it still does not make sense you might want to try the PHP forum for the exact syntax...

[conehead]
 
if you use php you should be able to display your results fairly easily, because php creates a variable based on every field passed to a script. so a field called 'name' creates a variable called '$name'

eg...

if your form contains a field called "surname", in your results page you could do something like...

<p>
Hello Mr/Mrs<? =$surname ?>
<p>

or if you want the longer version, so you can do a bit more with the data...

if you have a field in your form called &quot;gender&quot;...

<?
if($gender == 'male')
{
print &quot;<p>Hello Mr $surname<p>&quot;;
} else {
print &quot;<p>Hello Mrs $surname<p>&quot;;
}
?>

probably not a very good example, but i think it gives you an idea.

hope this helps,

ss...

 
an improvement:
Code:
<p>
Hello Mr/Mrs<? =$_METHOD['surname']; ?>
<p>

where METHOD is either GET/POST...

Known is handfull, Unknown is worldfull
 
I would like to thank you all for your help. I am going to ask for further help on a php forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top