All pastes #235110 Raw Edit

poppabear

public php v1 · immutable
·published 2006-11-03 00:40 UTC
rendered paste body
## this is the output after submit ##Please select a contactMessage Sent, Thank you for you feedback### this is the form ###          <form name="contact" method="post" action="contact.php">		  <br>		  <strong>Please choose a department to contact:</strong>		  <label><br>            <input name="radio" type="radio" value="1">            <strong>General Support, Billing</strong>            </label>             <br>            <label>              <input name="radio" type="radio" value="2">              <strong>Eggdrop, PsyBnc, Tcl Admin </strong></label>            <br>            <label>              <input name="radio" type="radio" value="3">            <strong>Web Design Admin </strong><br>            </label>			 			  <label>		                <input name="radio" type="radio" value="4">              <strong>Technical Support Admin</strong></label>		    <p><br>		      <strong><a href="#">General Support: Live Chat</a> </strong></p>			  <p>Username:<br>			  <input type="text" name="uname" size="20"> ( If already a customer. )<br>			  Firstname:<br>			  <input type="text" name="firstname" size="20"><br>			  Lastname:<br>			  <input type="text" name="lastname" size="20"><br>			  Email:<br>			  <input type="text" name="email" size="20"><br>			  Refered By:<br>			  <input type="text" name="referedby" size="20"> ( If applicable )<br><br><br>          Message to be sent to selected staff member:</p>			  <textarea name="comments" cols="40" rows="10" onClick="this.value=''" onFocus="value=">Your Comments Here ...</textarea>			  <br /><br>					<input type="submit" value="Submit" />          </form>## and this is the script ##<?php$body=$_REQUEST['uname'];$body=$_REQUEST['firstname'];$body=$_REQUEST['lastname'];$from=$_REQUEST['email'];$body=$_REQUEST['referedby'];$body=$_REQUEST['comments'];if(isset($_POST['radio']) && $_POST['radio']===1){  $email_address='poppabear@worxtech.com'; }elseif(isset($_POST['radio']) && $_POST['radio']===2){  $email_address='pip2kk@gmail.com'; }elseif(isset($_POST['radio']) && $_POST['radio']===3){  $email_address='support@aeonhosting.com'; }elseif(isset($_POST['radio']) && $_POST['radio']===4){  $email_address='mike@worxtech.net'; }else {echo "Please select a contact";} {if($body && $from) { mail($email_address, $body, $from) or die("email error");echo "Message Sent, Thank you for you feedback " . $name; } else {echo "All fields must be filled in!<BR>"; }}