Contact form on 123.reg
Hello,
I need to add a contact for to my site and used a Lynda.com tutorial to set up the initial page.
I have downloaded the script from 123.reg -
<?php
$EmailFrom = "info@yourdomain.co.uk";
$EmailTo = "info@yourdomain.co.uk";
$Subject = "online form";
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
echo "please check your details";
header("Location: http://yourdommain.co.uk/contact.php");
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
}
?>
I know I need to change the "yourdomain" parts but when I upload the php file (this script) I get a 404 message.
I have contacted 123 but was told that they cannot support code queries.
How I get my contact for to connect to the uploaded php file.
My contact form code is -
<div id="contact">
<form name="form1" method="post" action="http://www.ultimate-trumps.co.uk/formmail.php">
<span id="nameTextField">
<label for="Name"></label>
<input type="text" name="Name" id="Name">
<span class="textfieldRequiredMsg">A value is required.</span></span>
<p><span id="emailTextField">
<label for="email"></label>
<input type="text" name="email" id="email">
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></p>
<p><span id="messageTextArea">
<label for="Your message"></label>
<textarea name="Your message" id="Your message" cols="45" rows="5"></textarea>
<span id="countmessageTextArea"> </span><span class="textareaRequiredMsg">A value is required.</span><span class="textareaMinCharsMsg">Minimum number of characters not met.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
<p>
<input type="submit" name="submit" id="submit" value="Submit">
</p>
</form>
</div>
I have used a SpryAsset to create the code.
Any help is appreciated.
Thanks in advance!
