The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Calling a PHP Script, Submitting a form not calling the PHP script.
safe2drive
post 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"/> &lt;- type <b>SAFE2DRIVE</b> here.<br />

<p style="padding-top: 15px"><span>&nbsp;</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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 20 2012, 06:58 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,195
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"/> &lt;- type <b>SAFE2DRIVE</b> here.<br />

<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p>
</div>


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
safe2drive
post 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.



QUOTE(pandy @ Mar 20 2012, 11:58 AM) *

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"/> &lt;- type <b>SAFE2DRIVE</b> here.<br />

<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p>
</div>


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th July 2014 - 02:24 PM