Lokee116 Posted November 6, 2007 Share Posted November 6, 2007 Hello I'm creating a simple application form for a client. They would like a spot to enter an Auth Code and depending on the code it would return the user to one of a few different pages. ex. if they enter the Auth Code "2231" the user would see page "A" after submission.. if they enter Auth Code "4322" the user would be directed to page "B" and so on. I Think this can be achived with some if / if else statements but my php is pretty rusty in fact I cant even get the completed form to e-mail to us right. I'm using spry validations and inputs. and I can't seem to get my PHP right. any help would be greatly appreciated. some more details: I need the form data to be sent to an e-mail address and have the Auth Code compared and redirect the user to the completed page accordingly. the html code: <form id="dapp" name="dapp" method="post" action="SubmitChecker.php" onsubmit="return mySubmit(this);"> <table> <tr> <td>Business Name:</td> <td> <span id="sprytextfield1"> <input name="bname" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Business Name is required.</span></span></td></tr> <tr> <td>Business Type:</td> <td> <span id="sprytextfield2"> <input name="btype" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Business Type is required.</span></span></td></tr> <tr> <td>Name:</td> <td> <span id="sprytextfield3"> <input name="name" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Name is required.</span></span></td></tr> <tr> <td>E-Mail:</td> <td> <span id="sprytextfield4"> <input name="email" type="text" value=""/><br /> <span class="textfieldRequiredMsg">E-Mail is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td></tr> <tr> <td>Business Phone:</td> <td> <span id="sprytextfield5"> <input name="bphone" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Business Phone Number is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td></tr> <tr> <td>Your Phone:</td> <td> <span id="sprytextfield6"> <input name="phone" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Your Phone Number is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td></tr> <tr> <td>Address:</td> <td> <span id="sprytextfield7"> <input name="addr" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Address is required.</span></span></td></tr> <tr> <td>City:</td> <td> <span id="sprytextfield8"> <input name="city" type="text" value=""/><br /> <span class="textfieldRequiredMsg">City is required.</span></span></td></tr> <tr> <td>State:</td> <td><div id="State"> <span id="validsel1"> <select name="State" id="select1" tabindex="1"> <option value="">Please choose your state</option> <option value="Alabama">Alabama</option> <option value="Alaska">Alaska</option> <option value="Arizona">Arizona</option> <option value="Arkansas">Arkansas</option> <option value="California">California</option> <option value="Colorado">Colorado</option> <option value="Connecticut">Connecticut</option> <option value="Delaware">Delaware</option> <option value="Florida">Florida</option> <option value="Georgia">Georgia</option> <option value="Hawaii">Hawaii</option> <option value="Idaho">Idaho</option> <option value="Illinois">Illinois</option> <option value="Indiana">Indiana</option> <option value="Iowa">Iowa</option> <option value="Kansas">Kansas</option> <option value="Kentucky">Kentucky</option> <option value="Louisiana">Louisiana</option> <option value="Maine">Maine</option> <option value="Maryland">Maryland</option> <option value="Massachusetts">Massachusetts</option> <option value="Michigan">Michigan</option> <option value="Minnesota">Minnesota</option> <option value="Mississippi">Mississippi</option> <option value="Missouri">Missouri</option> <option value="Montana">Montana</option> <option value="Nebraska">Nebraska</option> <option value="Nevada">Nevada</option> <option value="New Hampshire">New Hampshire</option> <option value="New Jersey">New Jersey</option> <option value="New Mexico">New Mexico</option> <option value="New York">New York</option> <option value="North Carolina">North Carolina</option> <option value="North Dakota">North Dakota</option> <option value="Ohio">Ohio</option> <option value="Oklahoma">Oklahoma</option> <option value="Oregon">Oregon</option> <option value="Pennsylvania">Pennsylvania</option> <option value="Rhode Island">Rhode Island</option> <option value="South Carolina">South Carolina</option> <option value="South Dakota">South Dakota</option> <option value="Tennessee">Tennessee</option> <option value="Texas">Texas</option> <option value="Utah">Utah</option> <option value="Vermont">Vermont</option> <option value="Virginia">Virginia</option> <option value="Washington">Washington</option> <option value="West Virginia">West Virginia</option> <option value="Wisconsin">Wisconsin</option> <option value="Wyoming">Wyoming</option> </select> <br/> <span class="selectRequiredMsg">Please choose your state.</span> </span> </div></tr> <tr> <td>Zip Code:</td> <td> <span id="sprytextfield9"> <input name="zip" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Zip Code is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td></tr> <tr> <td>Auth Code:</td> <td> <span id="sprytextfield10"> <input name="auth" type="text" value=""/><br /> <span class="textfieldRequiredMsg">Auth Code is required.</span> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td></tr> <tr> <td> <tr> <td colspan="2"><hr width="60%" />To continue please read and accept the <a href="http://www.fastwebtrain.com/tc/Code-A.doc">Terms and Conditions.</a> <center><a href="http://www.fastwebtrain.com/tc/Code-A.doc">Terms and Conditions</a></center> <span id="acceptContainer1"> <label for="accept"> <input type="checkbox" name="accept" id="accept" checked"off" /> I accept</label> <span class="checkboxRequiredMsg">You cannot submit the form until you accept the terms and Conditions agreement!</span> </span></td></tr> <tr> <td> <div class="buttons"> <input type="submit" name="Submit" id="submit" value="Submit"/> <input type="reset" name="Reset" id="reset" value="Reset" /> </div></td></tr> </table> </form> <script type="text/javascript"> <!-- var acceptContainer1 = new Spry.Widget.ValidationCheckbox("acceptContainer1", {isRequired:true, validateOn:["change"]}); var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "integer", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "integer", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "none", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "none", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "zip_code", {isRequired:true, hint:"", validateOn:["change"]}); var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "integer", {isRequired:true, hint:"", validateOn:["change"]}); var validsel1 = new Spry.Widget.ValidationSelect("validsel1", {isRequired:true, validateOn:["change"]}); var mySubmit = function(form){ var ret = Spry.Widget.Form.validate(form); if (!ret){ } return ret; } //--> </script> basically i need to write a php that will email the form info to an email and then redirect the user based on the Auth Code they've entered. the form is hosted at http://www.fastwebtrain.com/dapp.html Please help me if you can Im teh sux at php ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.