...

View Full Version : need help with html forms



htmlnoob1
11-07-2010, 04:39 AM
Hey guys, im hoping some of you can help me. I need to create a website, which ive done kind of lol and I need to include a page where people can make bookings online.

I just cant seem do it right. Its really difficult for me because im not allowed to use dreamweaver or anything, it all has to be done in notepad and im really struggling with this. It just basically needs to have:

First name:
Last name:
Address:
How many people: (drop down list)
Contact number:
Where did you hear about us?: (with some radio buttons)

I am over the age of 18: (checkbox)

Submit button that actually sends an email to my email adress. I have tried and tried and theres not even any decent guides to follow.

It isnt allowed to contain any other languages apart from html.

Please someone help me! It needs to be in my monday please....

Chris Hick
11-07-2010, 04:44 AM
I will do this for a small fee.. but you're not getting this done for free..

htmlnoob1
11-07-2010, 03:03 PM
Im broke lol isnt there anyone that can quickly whip me something up? It doesnt have to have any color or be fancy or anything... just a simple form please im really desperate!

BAW
11-07-2010, 03:07 PM
Here, take a look on this site, they have a bit on forms in HTML - http://www.htmldog.com

Main pages urll want to see - http://www.htmldog.com/guides/htmlbeginner/forms/ & http://www.htmldog.com/guides/htmladvanced/forms/

htmlnoob1
11-07-2010, 04:02 PM
Here, take a look on this site, they have a bit on forms in HTML - http://www.htmldog.com

Main pages urll want to see - http://www.htmldog.com/guides/htmlbeginner/forms/ & http://www.htmldog.com/guides/htmladvanced/forms/

Dude thank you so much you are a life saver! I just need to make the submit button actually send the information I input to my email address then im all done. How would I go about doing that? Here is what I have so far.


<form action="booking.php" method="post">

<p><font size="3">Please fill in the booking form below. Fields with an astrix are mandatory.</p>
<p>First name:</p>
<p><input type="text" name="name" value="" /></p>
<p>Last Name:</P>
<p><input type="text" Last name="name" value="" /></p>
<p>Full address including post code:</p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>


<p>Where did you hear about us:</p>
<p><input type="radio" name="where" value="Barking & Dagenham Post" checked="checked" /> Barking & Dagenham Post</p>
<p><input type="radio" name="where" value="Google" /> Google</p>
<p><input type="radio" name="where" value="Leaflet" /> Leaflet</p>
<p><input type="radio" name="where" value="Friends" /> Friends</p>
<p><input type="radio" name="where" value="Television" /> Television</p>
<p><input type="radio" name="where" value="Other" /> Other (please specify)</p>

<p>If you selected other, please tell us where you heard about us: </p>
<p><textarea name="comments" rows="5" cols="40"></textarea></p>
<br />
<br />
<br />
<p><input type="checkbox" name="yesorno" value="terms and conditions" /> Do you accept our terms and conditions?</p>

<p><input type="submit" /></p>

<p><input type="reset" /></p>

</form>

BAW
11-07-2010, 04:13 PM
Dude thank you so much you are a life saver! I just need to make the submit button actually send the information I input to my email address then im all done. How would I go about doing that? Here is what I have so far.


<form action="booking.php" method="post">

<p><font size="3">Please fill in the booking form below. Fields with an astrix are mandatory.</p>
<p>First name:</p>
<p><input type="text" name="name" value="" /></p>
<p>Last Name:</P>
<p><input type="text" Last name="name" value="" /></p>
<p>Full address including post code:</p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>


<p>Where did you hear about us:</p>
<p><input type="radio" name="where" value="Barking & Dagenham Post" checked="checked" /> Barking & Dagenham Post</p>
<p><input type="radio" name="where" value="Google" /> Google</p>
<p><input type="radio" name="where" value="Leaflet" /> Leaflet</p>
<p><input type="radio" name="where" value="Friends" /> Friends</p>
<p><input type="radio" name="where" value="Television" /> Television</p>
<p><input type="radio" name="where" value="Other" /> Other (please specify)</p>

<p>If you selected other, please tell us where you heard about us: </p>
<p><textarea name="comments" rows="5" cols="40"></textarea></p>
<br />
<br />
<br />
<p><input type="checkbox" name="yesorno" value="terms and conditions" /> Do you accept our terms and conditions?</p>

<p><input type="submit" /></p>

<p><input type="reset" /></p>

</form>

I believe you would change the
form action="booking.php" to something else, let me have a look.


*EDIT* you need to put

<form action="mailto:youremail@email.com" method="post">

Let me know how it goes!!

htmlnoob1
11-07-2010, 04:33 PM
Slight problem, when I click the submit button it opens up outlook rather then just sends it to my email... hmm ill have a look into it. Thanks very much for your help so far!

BAW
11-07-2010, 05:10 PM
Slight problem, when I click the submit button it opens up outlook rather then just sends it to my email... hmm ill have a look into it. Thanks very much for your help so far!


<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "email@address";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>

That is PHP but I believe you can include it in the HTML doc! (you need to change email@address to ur email addy)
This code needs to go to booking.php after u submit so change the form action back!


<form action="booking.php" method="post">

htmlnoob1
11-07-2010, 05:50 PM
Thanks alot man I really apprciated the help. I just emailed my tutor and he said what I have already is fine. Including the php script would count as a fail. For one we havent learnt html so he would know I just copied it. Secondly we are being marked for our html code.

He said its fine aslong as it works.. which it does. Thanks very much mate!

BAW
11-07-2010, 05:52 PM
No probs mate!

davm22
11-07-2010, 06:30 PM
Im interested in getting the 'Submit' button to send an email to me or save somehow. How can I do this? Anytime I try I get the same problem with Outlook opening up. I just want the user to go on to my site, input all the details, click submit, shown a 'Thanks' page then the information is sent to me somehow.

How could I do this?

BAW
11-07-2010, 07:44 PM
Im interested in getting the 'Submit' button to send an email to me or save somehow. How can I do this? Anytime I try I get the same problem with Outlook opening up. I just want the user to go on to my site, input all the details, click submit, shown a 'Thanks' page then the information is sent to me somehow.

How could I do this?


Right, you need to create your form, for example -


<form action="thanks.php" method="post">

<p><font size="3">Please fill in the booking form below. Fields with an astrix are mandatory.</p>
<p>First name:</p>
<p><input type="text" name="name" value="" /></p>
<p>Last Name:</P>
<p><input type="text" Last name="name" value="" /></p>
<p>Full address including post code:</p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>
<p><input type="text"" value="" /></p>


<p>Where did you hear about us:</p>
<p><input type="radio" name="where" value="Barking & Dagenham Post" checked="checked" /> Barking & Dagenham Post</p>
<p><input type="radio" name="where" value="Google" /> Google</p>
<p><input type="radio" name="where" value="Leaflet" /> Leaflet</p>
<p><input type="radio" name="where" value="Friends" /> Friends</p>
<p><input type="radio" name="where" value="Television" /> Television</p>
<p><input type="radio" name="where" value="Other" /> Other (please specify)</p>

<p>If you selected other, please tell us where you heard about us: </p>
<p><textarea name="comments" rows="5" cols="40"></textarea></p>
<br />
<br />
<br />
<p><input type="checkbox" name="yesorno" value="terms and conditions" /> Do you accept our terms and conditions?</p>

<p><input type="submit" name="Submit" value="Send" /></p>

<p><input type="reset" /></p>

</form>



Then u need a page that relates to the "thanks.php"

that cotains this -

<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "PUT UR EMAIL ADDY HERE!!";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>


Give that a shot!

davm22
11-07-2010, 10:40 PM
New Thread Started

BAW
11-07-2010, 11:25 PM
Hi,

I have looked into this, and im affraid I cannot help u any further. I will be looking into this more coz im interested now BUT im sure there is someone else who can help out here!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum