Calling a PHP Script, Submitting a form not calling the PHP script. |
Calling a PHP Script, Submitting a form not calling the PHP script. |
safe2drive |
Mar 20 2012, 04:00 AM
Post
#1
|
Group: Members Posts: 2 Joined: 20-March 12 Member No.: 16,751 |
have written my first PHP script to handle a contact form. After a few initial problems, the web hosting company changed a few lines of code around and said they have tested the script and all was working OK. Indeed I received the email with the details they had entered. However, I cannot get it to run at home and have tried 3 separate PC's and laptops. I have tried F5 etc. The mystery deepens as I tried it on my Iphone and Ipad and it works perfectly.
When you have entered all the details and hit the submit button, the php script isn't being called as is shown in the url from my Iphone. This is the section in the contact form for the submit button. form action="http://www.safe-2-drive.co.uk/myform.php" method="post"> <div class="form_settings"> <p><span>Name: *</span><input class="contact" type="text" name="yourname" value="" /></p> <p><span>Contact No: *</span><input class="contact" type="text" name="contact" value="" /></p> <p><span>E-mail:</span><input type="text" name="email" /></p> <p><span>Driving Experience:</span> </p> <form action=""> <select name="drivingexperience"> <option value="Never driven before">Never driven before</option> <option value="Had a few lessons">Had a few lessons</option> <option value="Just failed L test">Just failed L test</option> <option value="Pass Plus">Want to take Pass Plus</option> </select> </form> </p> <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="message"></textarea></p> <p><span>Access Code: *</span><input type="text" name="code" size="10" maxlength="10" style="width:70px"/> <- type <b>SAFE2DRIVE</b> here.<br /> <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p> </div> This is the web site page -> safe-2-drive.co.uk.contact.html Any help would be greatly apreciated. |
pandy |
Mar 20 2012, 06:58 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
You have 2 start tags for FORM. Browsers choose the second one without attributes, so nothing happens.
Some form controls, among them the submit button, are outside the form. The form won't be submitted when you click the button because of this, it has no connection to the form. The start tag for FORM also lacks the beginning '<', but I guess that was a mishap when pasting I submitted the form (after corrections) and it worked. I used the name pandy and wrote "testing" in the textarea if you need to clean it out. QUOTE form action="http://www.safe-2-drive.co.uk/myform.php" method="post"> <div class="form_settings"> <p><span>Name: *</span><input class="contact" type="text" name="yourname" value="" /></p> <p><span>Contact No: *</span><input class="contact" type="text" name="contact" value="" /></p> <p><span>E-mail:</span><input type="text" name="email" /></p> <p><span>Driving Experience:</span> </p> <form action=""> <select name="drivingexperience"> <option value="Never driven before">Never driven before</option> <option value="Had a few lessons">Had a few lessons</option> <option value="Just failed L test">Just failed L test</option> <option value="Pass Plus">Want to take Pass Plus</option> </select> </form> </p> <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="message"></textarea></p> <p><span>Access Code: *</span><input type="text" name="code" size="10" maxlength="10" style="width:70px"/> <- type <b>SAFE2DRIVE</b> here.<br /> <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p> </div> |
safe2drive |
Mar 20 2012, 07:27 AM
Post
#3
|
Group: Members Posts: 2 Joined: 20-March 12 Member No.: 16,751 |
Hi pandy,
Much appreciated and thanks for taking the time to solve my issue. I had a feeling it would be something simple. Cheers. You have 2 start tags for FORM. Browsers choose the second one without attributes, so nothing happens. Some form controls, among them the submit button, are outside the form. The form won't be submitted when you click the button because of this, it has no connection to the form. The start tag for FORM also lacks the beginning '<', but I guess that was a mishap when pasting I submitted the form (after corrections) and it worked. I used the name pandy and wrote "testing" in the textarea if you need to clean it out. QUOTE form action="http://www.safe-2-drive.co.uk/myform.php" method="post"> <div class="form_settings"> <p><span>Name: *</span><input class="contact" type="text" name="yourname" value="" /></p> <p><span>Contact No: *</span><input class="contact" type="text" name="contact" value="" /></p> <p><span>E-mail:</span><input type="text" name="email" /></p> <p><span>Driving Experience:</span> </p> <form action=""> <select name="drivingexperience"> <option value="Never driven before">Never driven before</option> <option value="Had a few lessons">Had a few lessons</option> <option value="Just failed L test">Just failed L test</option> <option value="Pass Plus">Want to take Pass Plus</option> </select> </form> </p> <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="message"></textarea></p> <p><span>Access Code: *</span><input type="text" name="code" size="10" maxlength="10" style="width:70px"/> <- type <b>SAFE2DRIVE</b> here.<br /> <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p> </div> |
Lo-Fi Version | Time is now: 26th April 2024 - 03:54 AM |