Ive followed a tutorial online to create a basic contact page (I have just copied and pasted the code to start with) but it doesnt work....
Can anyone tell me, or point me in the right direction of how to make a contact form using xhtml preferably as I dont know php although I am williing t o learn a bit if its not possible with JUST xhtml...
thanks guys...
Thanks Toon, but is there no way of me creating one where the message simply gets sent to my email address?
what language are you writing it in?
PHP or JavaScript?
haha, thats the thing...xhtml
Whats the easiest way for me to do what I want to do?
The tutorial that I followed and of which used a bit of php script creates this but it doesnt work...
after you get your XHTML form set and retrieve all the data from it with PHP make sure you have something similar to this (this is copy and pasted from my personally developed code so you will have to tweak it a little)DONT JUST BYTE MY CODE! figure out why it is the way it is.
to put it into context i will post the whole control.PHP Code:$to = "ross@justross.com";
$from = repme();
function repme() {
if ($from == "@batmobile.websitewelcome.com") {
$from = "$email_1" - "@batmobile.websitewelcome.com";
} else {
$from = "$email_1";
}
}
mail ($to, $_POST['subject_text'], $body, $from );
and so you can see what they are related too.PHP Code:<?php
//////////////////////////
// VALIDATION ERR //
//////////////////////////
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
$prefix = $_POST['prefix'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email_1 = $_POST['email_1'];
$email_2 = $_POST['email_2'];
$phone_1 = $_POST['phone_1'];
$phone_2 = $_POST['phone_2'];
$cell = $_POST['cell'];
$fax = $_POST['fax'];
$subject_type = $_POST['subject_type'];
$tone = $_POST['tone'];
$subject_text = $_POST['subject_text'];
$message = $_POST['message'];
$send = $_POST['send'];
print "<p class=\"hilite\">Thank you for taking the time to contact me. The following is the information you have provided.</p>
<p>$prefix $first_name $last_name</p>
<p>
$email_1<br />
$email_2<br />
$phone_1<br />
$phone_2<br />
$cell<br />
$fax
</p>
<p>
$subject_type<br />
$tone<br />
$subject_text<br />
$message
</p>";
$body = "
Tone: $tone
Type: $subject_type
$message
$prefix $first_name $last_name
$email_1
$email_2
$phone_1
$phone_2
$cell
$fax
";
$to = "ross@justross.com";
$from = repme();
function repme() {
if ($from == "@batmobile.websitewelcome.com") {
$from = "$email_1" - "@batmobile.websitewelcome.com";
} else {
$from = "$email_1";
}
}
mail ($to, $_POST['subject_text'], $body, $from );
?>
DONT JUST BYTE MY CODE! figure out why it is the way it is.HTML Code:<form action="validation.php" method="post"> <legend>Name:</legend> <fieldset> <p> <select name="prefix"> <option>Prefix</option> <option value="Mr.">Mr.</option> <option value="Mrs.">Mrs.</option> <option value="Ms.">Ms.</option> </select> <label class="required">First:</label> <input type="text" name="first_name" size="18" /> <label class="required">Last:</label> <input type="text" name="last_name" size="30" /> </p> </fieldset> <legend>Email Adress:</legend> <fieldset> <p> <label class="required">Primary Email:</label> <input type="text" name="email_1" size="50" /> <label>Secondary Email:</label> <input type="text" name="email_2" size="50" /> </p> </fieldset> <legend>Phone Numbers:</legend> <fieldset> <p> <label class="required">Primary Phone Number:</label> <input type="text" name="phone_1" size="50" /> <label>Secondary Phone Number:</label> <input type="text" name="phone_2" size="50" /> <label>Mobile Number:</label> <input type="text" name="cell" size="50" /> <label>Fax Number:</label> <input type="text" name="fax" size="50" /> </p> </fieldset> <legend>Subject:</legend> <fieldset> <p> <label>Subject Type:</label> <select name="subject_type"> <option value="work">Concerning Work:</option> <option value="play">Not Work Related:</option> <option value="thnx">Thank You:</option> <option value="help">Error / Problem:</option> <option value="other">Other:</option> </select> <label>Tone:</label> <select name="tone"> <option value="relaxed">Relaxed</option> <option selected value="casual">Casual</option> <option value="polite">Polite</option> </select> <label class="required">Subject Text:</label> <input type="text" name="subject_text" size="50" /> </p> </fieldset> <legend class="required">Message:</legend> <fieldset> <p> <textarea name="message" rows="7" cols="50">Please enter your comments here.</textarea> </p> </fieldset> <input class="button" type="submit" value="SEND" name="send" /> </form>
I developed this, it should help: Multiple Emails - PHP :: Labs - PR Design's Public Laboratory
Thinks Ive cracked it...can some one check for me?
Phil Johns Imaging - Website and Graphic Design
Is the email being sent through a third party site? It's very slow, and possibly less reliable than one made by yourself.
Check the forum often for the latest design announcements. Everything from graphic design and web design, to films and music. Estetica is a great place for people to get together and help each other out.
Bookmarks