ben3001 Posted March 14, 2006 Author Share Posted March 14, 2006 i dont think the php likes the javascript, now im getting error on line 55 Link to comment Share on other sites More sharing options...
scott100 Posted March 14, 2006 Share Posted March 14, 2006 Leave it with me, i can't use any php scripts just now so i'll check it out tonight and post back. Link to comment Share on other sites More sharing options...
ben3001 Posted March 14, 2006 Author Share Posted March 14, 2006 may i say at this time thanks for all your help so far scott you've been excellent Link to comment Share on other sites More sharing options...
scott100 Posted March 14, 2006 Share Posted March 14, 2006 it's ok Right i have been testing this code and have finally managed to get it to work.Basically i had to end the php before the date anchor tag and begin it again straight after.ok, same as before, save as form.php, make sure external js's are in the same folder and change to your email address.finger crossed <head><script language="javascript" src="cal2.js"></script><script language="javascript" src="cal_conf2.js"></script></head><body><?php ini_set ('display_errors', 1);error_reporting (E_ALL & ~E_NOTICE);// Check if the form has been submitted.if ( isset ($_POST['submit'])) {$customer=$_POST['custName'];$customerEmail=$_POST['custEmail'];$customerContact=$_POST['custContact'];$customerNumber=$_POST['custNum'];$customerComment=$_POST['custComment'];$theDate=$_POST['firstinput'];$validEmail=true;if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $customerEmail)) { }else {$validEmail=false;}if(($customer==null)||($validEmail==false)||($customerContact==null)||($customerComment==null)||($theDate==null)) { print"Form Incomplete, press back to return to form"; }else { mail("me@me.com","subject","$customer $customerContact $customerNumber $customerComment","From:$customerEmail"); print "<h1>Congratulations, Form Complete</h1> <p>Customer Name: $customer</p> <p>Customer Email: $customerEmail</p> <p>Customer Contact: $customerContact</p> <p>Customer Number: $customerNumber</p><p>Date: $theDate</p> <p>Customer Comment: $customerComment</p> "; }} else { // Display the form.print 'Book OnlineUse the booking form below to submit your booking for a night out at Medussa Brixton. Please ensure all fields are filled out correctly. You will be contacted within twenty-four hours via phone to confirm your booking. Please leave any additional information in the comments box.<form name="sampleform" action="form.php" method="post">Name <input type="text" name="custName" size="25" maxlength="35" /><br />Email <input type="text" name="custEmail" size="35" maxlength="100" /><br />Contact <input type="text" name="custContact" size="20" maxlength="20" /><br />Customer Number<select name="custNum"><option value="1-10">1-10</option><option value="11-15">11-15</option><option value="16-20">16-20</option><option value="21-30">21-30</option><option value="31-40">31-40</option><option value="41-50">41-50</option><option value="51-60">51-60</option><option value="61-70">61-70</option><option value="71-80">71-80</option><option value="81-90">81-90</option><option value="91-100">91-100</option><option value="100+">100+</option></select><br /><input type="text" name="firstinput" size="20">';?><a href="java script:showCal('Calendar1')">Select Date</a><br /><br /><?php print 'Customer Comment<textarea name="custComment"></textarea><br /><br /><input type="submit" name="submit" value="Send" /><input type="reset" name="Reset" value="Reset" /></form>';}?></body> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now