a different contact form ... please help!!!!

can someone tell me how to include all of the input fields in the form below please????


PHP:
<?php

if ($_POST[t] == 'process'){

mail('[email protected]','Contact Form Submission',stripslashes($_POST[message]),'FROM:'.$_POST[email]);

echo'<table border="0" width="98%" cellspacing="3" cellpadding="0"><tr><td width="100%" valign="top" align="center" class="content">';
echo'<br /><br /><p>Thank you, your message was sent to the webmaster.</p>'."";
echo'</td></tr></table>';

} else {

echo'<form action="'.$_SERVER[PHP_SELF].'" method="post">'."";
echo'<input type="hidden" name="t" value="process"></input>'."";
echo'Your E-Mail Address: <input type="text" name="email" size="30" value=""></input><br /><br />'."";
echo'Your name: <input type="text" name="name" size="20"><br /><br />'."";
echo'Your phone: <input type="text" name="phone" size="20"><br /><br />'."";
echo'Select subject: <select size="1" name="subject">
    <option selected>Wants List</option>
    <option>Book Purchase</option>
    <option>Shipping</option>
    <option>Request To View A Book</option>
    <option>Books For Sale</option>
    <option>Returns</option>
    <option>Other</option>
  </select><br /><br />'."";
echo'Preferred way of contact? <input type="checkbox" name="contactemail" value="ON">email <input type="checkbox" name="contactphone" value="ON">phone<br /><br />'."";
echo'Your Message:<br /><textarea name="message" cols="30" rows="8"></textarea><br /><br />'."";
echo'<input type="submit" value="Send E-Mail"></input>'."";
echo'</form>';
}
?>
 
Just incase someone else finds this and needs it, here is a working version of the script ...

PHP:
<?php

if ($_POST[t] == 'process'){

 $msg = ""; 
foreach ($_POST as $key => $value) { 
    if($key <> "t"){ 
        $msg .= "$key: $value\n"; 
    } 
}  
mail('[email protected]','Contact Form Submission',stripslashes($msg),'FROM: [email protected]');

echo'<table border="0" width="98%" cellspacing="3" cellpadding="0"><tr><td width="100%" valign="top" align="center" class="content">';
echo'<br /><br /><p>Thank you, your message was sent to the webmaster.</p>'."";
echo'</td></tr></table>';

} else {

echo'<form action="'.$_SERVER[PHP_SELF].'" method="post">'."";
echo'<input type="hidden" name="t" value="process"></input>'."";
echo'Your E-Mail Address: <input type="text" name="email" size="30" value=""></input><br /><br />'."";
echo'Your name: <input type="text" name="name" size="20"><br /><br />'."";
echo'Your phone: <input type="text" name="phone" size="20"><br /><br />'."";
echo'Select subject: <select size="1" name="subject">
    <option selected>Wants List</option>
    <option>Book Purchase</option>
    <option>Shipping</option>
    <option>Request To View A Book</option>
    <option>Books For Sale</option>
    <option>Returns</option>
    <option>Other</option>
  </select><br /><br />'."";
echo'Preferred way of contact? <input type="checkbox" name="contactemail" value="ON">email <input type="checkbox" name="contactphone" value="ON">phone<br /><br />'."";
echo'Your Message:<br /><textarea name="message" cols="30" rows="8"></textarea><br /><br />'."";
echo'<input type="submit" value="Send E-Mail"></input>'."";
echo'</form>';
}
?>
 
Back
Top