- This topic is empty.
-
AuthorPosts
-
November 17, 2008 at 5:09 pm #23594kevonGarciaMember
hi i downloaded the code from chris and for some reason its not re directing my pages… I edited the come to suit my form here goes:
<?php
// CHANGE THE VARIABLES BELOW
$EmailFrom = "sample limited";
$EmailTo = "[email protected]";
$Subject = "Contact Form Submission";$Name = Trim(stripslashes($_POST));
$Email = Trim(stripslashes($_POST));
$Number = Trim(stripslashes($_POST));
$Reason =Trim(stripslashes($_POST));
$Comment = Trim(stripslashes($_POST));// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "n";
$Body .= "Number: ";
$Body .= $Number;
$Body .= "n";
$Body .= "Reason: ";
$Body .= $Reason;
$Body .= "n";
$Body .= "Comment: ";
$Body .= $Comment;
$Body .= "n";// send email
$success = mail($EmailTo, $Subject, $Body, "From: $EmailFrom");// redirect to success page
// CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE
if ($success){
print "<meta http-equiv="refresh" content="0;URL=thankyou.html">";
}
else{
print "<meta http-equiv="refresh" content="0;URL=error.html">";
}
?>my html is:
<form id="myform">
<fieldset><ul class="form">
<li class="who"> <label for="form_name">Full Name</label><span class="required">Required</span>
<input id="form_name" class="is_required" name="Name" type="text" /></li><li class="email"> <label for="form_email">E-mail Address</label><span class="required">Required</span>
<input id="form_email" class="vemail" name="Email" type="text" /></li><li class="vphone"> <label for="form_number">Contact Number</label><span class="required">Required</span>
<input id="form_number" class="is_required" name="Number" type="text" /></li><li class="why"> <label for="form_reason">I’m sending this because</label><span class="required"></span>
<select id="form_reason" class="is_required" name="Reason">
<option>I’m interested in Design Services</option>
<option>I want to Advertise on your site</option> </select></li><li class="comments"> <label for="form_comment">Comments</label><span class="required">Required</span>
<textarea id="form_comment" class="is_required" name="Comment"></textarea></li><li class="submit"> <input id="send_contact" type="submit" value="Send" /></li>
</ul>
</fieldset>
</form>i also validated the form using jquery, :) not the one supplied with the download and it works the validation and the general function of the form works well but its just the re direction of the page after the submit
sigh… help me please
November 18, 2008 at 2:53 am #51240ubaMemberYou can try another way instead of redirecting from the client side you can redirect it from the server using:
Code:header(“Location: page_name.html”);
exit;November 18, 2008 at 11:24 pm #51247kevonGarciaMemberI took a break form my routine coding and I pondered and pondered then it hit me…. Well one things for sure i placed the Send.php file in my script folder on the server so it was giving me an error for some strange reason.I think it was could not find thankyou.html in Script folder So I placed it into the public folder of my server and it eliminated the error. in addition to that I forgot to specify <form id="myform" method="post" action="Send.php" id="myform"> within my contact page html. It works great now.
A huge thank you to all the people who helped me I really appreciate it!!!
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.