Click to See Complete Forum and Search --> : my first phph program need help


tane
06-17-2003, 01:10 AM
I am new to php and at the very beginning stages....I am doing a feeback form for a friend :
HERE IS THE HTML CODE

<html>
<head>
<title>ciscos feedbackform</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form method="post" action="sendmail.php">
Name: <input name="name" type="text" /><br />
<br />
Age: <input name="age" type="text" /><br />
<br />
sex: <input name="sex" type="text" /><br />
<br />
Email: <input name="email" type="text" /><br />
<br />

<input type="submit" />

<input type="reset" name="reset" value="Reset">
</form>
</body>
</html>

AND HERE IS THE PHP PROGRAM I WROTE

<?
$name = $_REQUEST['name'] ;
$age = $_REQUEST['age'] ;
$sex = $_REQUEST['sex'] ;
$email = $_REQUEST['email'] ;

mail ( "tane@optusnet.com.au", "Ciscos form results","$name, $age, $sex, $email", "From: $email" ) ;
header( "Location: http://www.ciscoscoffeeroasters.com.au/thankyou.htm" );
?>


when i get the results sent to me in my email it comes to my email like this:

name,age,sex,email

Is there away of having the results sent to my email with question's that was asked and the answers instead of just the answers like above e.g

name = tane
age = 31
location = australia
email = tane@optusnet.com.au

AdamGundry
06-17-2003, 07:07 AM
You should be able to change this line

mail ( "tane@optusnet.com.au", "Ciscos form results","$name, $age, $sex, $email", "From: $email" ) ;

to this

mail ( "tane@optusnet.com.au", "Ciscos form results","name = $name\nage = $age\nsex = $sex\nemail = $email", "From: $email" );

Adam

pyro
06-17-2003, 07:09 AM
You may want to use something more like the form processor in this thread: http://forums.webdeveloper.com/showthread.php?s=&threadid=9543

tane
06-18-2003, 08:09 AM
excellent thanks guys