HI, can someone help? I need a script for 'contact us' form and don't know html. My host go daddy doesn't provide scripting service. I need a form that says : name : email : country : message : text box This is the sample script given by go daddy: <form action="gdform.asp" method="post"> <input type="hidden" name="subject" value="Form Submission"> <input type="hidden" name="redirect" value="thankyou.html"> <input name="FirstName"> <br> <input name="LastName"> <br> <input name="email"> <br> <textarea name="comments" cols="40" rows="10"></textarea> </form> pls let me know where I shall insert my details like email address, domain name. tks for your help
You will need to add more <option> tags in the Main file for more countries. You will need to edit the line in process.php file starting with mail() to include your email address and the subject you want the email to have. Hopefully this helps. Some editing may be necessary to get it to look correctly in your website. Main File: <form action="process.php" method="post"> Name: <input type="text" name="name"><br> Email: <input type="text" name="email"><br> Country: <select name="country"><option value="United States">United States</option><option value="Canada">Canada</option></select><br> Message: <textarea rows="5" cols="30" name="message"></textarea> process.php File <?php $name = $_POST['name']; $email = $_POST['email']; $country = $_POST['country']; $message= $_POST['message']; $completeemail = "Name: ".$name."\nEmail: ".$email."\nCountry: ".$country."\nMessage: ".$message; mail( "email@email.com", "Email Subject", $completeemail, "From: $email"); print("You have successfully sent a Contact Form."); ?> Code (markup):
Thanks. I want to have the whole list of countries there, any ready script that I can pluck in? where do i insert this "<form action="gdform.asp" method="post"> " which is godaddy's form code? and my email address and my domain? where do they go? tks
phpgator - do you just need the 2 files and that's it? Main File - that's the page we want the details to appear on is that right? I tried doing one of these through fantastico and I could not for the life of me work it out. What you have there looks heaps more simple than the fantastico one, I downloaded theirs and there were heaps of files, I didn't know what ones I was supposed to be using - very confusing.
Yeah, the main file code needs to be inserted into your template. Technically, you could just save this as a file of its own and open it in internet explorer, but it will be ugly and won't fit with your website. The process.php file pretty well needs to have the same thing, but it HAS to be named process.php to work properly. The reason is is because once the user submits the form it will go to process.php. I can get it setup for you, but since each website is designed differently I can't tell you exactly where to put the code without having access to your web files. I can do it for you and you can tip me whatever you feel like if you want.
Ignore Godaddy's code if you are inserting mine. As far as Countries you could go here: http://en.wikipedia.org/wiki/List_of_countries This lists all of them, then all you need to do is do: <option value="Greece">Greece</option> <option value="Italy">Italy</option> would be time consuming, but you can do it that way if you want.
Ok, I've had a go at setting it up and I think its ok, just one question - my boxes don't line up very well so looks a bit messy - how do you set it up so the boxes line up? the - do I put my email in there? Do I need to have my email in there somewhere for it to send it to me?