![]() |
#11 |
![]() Join Date: Feb 2006
Location: finland
Posts: 1,684
|
![]() hmm - put in the new html and php and used my email address http://gekkoweb.com/hl2015/form.html but now when i fill it in and press submit it simply refreshes the form or empties it. no email arrives, it isn't redirected to the thank you page. no error message
|
![]() |
![]() |
![]() |
#12 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() Thats odd.ill check in the morning when i get in the office. I did test it live this time so im not sure at the moment
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#13 |
![]() Join Date: Feb 2006
Location: finland
Posts: 1,684
|
![]() probably me then
![]() ![]() |
![]() |
![]() |
![]() |
#14 |
![]() Join Date: Feb 2006
Location: finland
Posts: 1,684
|
![]() tried again - copy and pasted you code and only modifed the email (to mine) same thing. form just resets
|
![]() |
![]() |
![]() |
#15 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() sorry Dave the error is at the form i suspect, when i tested this i used as a one page, ie the php block above the html code. i then just split it and posted separately.
I retested it today and it is working. BTW to debug change in the form Code:
<input class="robotic" type="text" name="myrealname" id="myrealname"> to <input class="robotic" type="text" name="myrealname" id="myrealname" value="anything">
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#16 |
![]() Join Date: Feb 2006
Location: finland
Posts: 1,684
|
![]() not sure i understand - changed that line and it still doesn't work - did you mean something else?
|
![]() |
![]() |
![]() |
#17 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() ok im rambling again. on your form you have send.php as the action so are you changing the php in send.php?
in any case here it is again but as one page, so it calls itself once submitted. this definitely works this time it sends an html mail. give it a whirl Code:
<?php $machine = $_POST['myrealname']; if ($machine != "") { echo 'naff off spammer'; exit(); //if a spambot filled out the "machine" //field, we don't proceed } else{ if (isset($_POST['Submit']) && $_POST['name'] != "") { $th_url= "thankyou.html"; // modify to page redirect after mail succsessfully sent if ($_POST['name'] != "") { $_POST['name'] = filter_var($_POST['name'], FILTER_SANITIZE_STRING); if ($_POST['name'] == "") { $errors .= 'Please enter a valid name.<br/><br/>'; } } else { $errors .= 'Please enter your name.<br/>'; } if ($_POST['email'] != "") { $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors .= "$email is <strong>NOT</strong> a valid email address.<br/><br/>"; } } else { $errors .= 'Please enter your email address.<br/>'; } /* Validating web address in form field ********************************************** */ if ($_POST['website'] != "") { $website = filter_var($_POST['website'], FILTER_SANITIZE_URL); if (!filter_var($website, FILTER_VALIDATE_URL)) { $errors .= "$website is <strong>NOT</strong> a valid URL.<br/><br/>"; } } else { $errors .= 'Please enter your home page.<br/>'; } /* end Validating web address in form field ********************************************** */ if ($_POST['Message'] != "") { $_POST['Message'] = filter_var($_POST['Message'], FILTER_SANITIZE_STRING); if ($_POST['Message'] == "") { $errors .= 'Please enter a message to send.<br/>'; } } else { $errors .= 'Please enter a message to send.<br/>'; } if (!$errors) { $to = 'myemail@gmail.com'; $subject = 'New Mail from ' . $_POST['email']; $headers = "From: " . strip_tags($to) . "\r\n"; $headers .= "Reply-To: ". strip_tags($to) . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = '<html><body>'; $message .= '<table width="100%"; style="border:1px solid #3A5896;" cellpadding="10">'; $message .='<tr><td>'. 'From: ' . $_POST['name']. '</td></tr>'; $message .= '<tr><td >'.'Email from: ' . $_POST['email'] . ' </td></tr>'; $message .= '<tr><td >'."Message:\n" . $_POST['Message'] . ' </td></tr>'; $message .= "</table>"; $message .= "</body></html>"; mail($to, $subject, $message, $headers ); header("Location: $th_url"); } else { echo '<div style="color: red">' . $errors . '<br/></div>'; } } } ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Contact</title> <style> #form{ position:relative; width: 500px; margin:0 auto; } label { float:left; clear:left; } input[type="text"], [type="url"], [type="email"]{ float:left; color: #555 ; width: 70%; border: 1px solid #e5e5e5; background: #fbfbfb; height: 25px; } .textarea{ float:left; height:100px; width: 70%; } .robotic { display: none; } </style> </head> <body> <div id="form"> <form action="" method="post"> <fieldset> <label for="name">Name:</label> <input id="name" name="name" type="text" required placeholder=" Your name" > </fieldset> <fieldset> <label >Email:</label> <input type="email" id="email" name="email" placeholder="me@mymail.com" required > </fieldset> <fieldset> <label>Website:</label> <input type="url" id="website" name="website" placeholder=" http://mysite.com" required > </fieldset> <fieldset> <label>Message</label> <textarea class="textarea" name="Message" id="Message" ></textarea> </fieldset> <fieldset> <input class="robotic" type="text" name="myrealname" id="myrealname" > <input type="submit" name="Submit" value="Submit"> <input name="reset" type="reset"> </fieldset> </form> </div> </body> </html>
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#18 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() acctually i just tested your fornm and it retured the error please enter home page which is not on the form.
the validaytion for that is Code:
/* Validating web address in form field ********************************************** */ if ($_POST['website'] != "") { $website = filter_var($_POST['website'], FILTER_SANITIZE_URL); if (!filter_var($website, FILTER_VALIDATE_URL)) { $errors .= "$website is <strong>NOT</strong> a valid URL.<br/><br/>"; } } else { $errors .= 'Please enter your home page.<br/>'; }
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#19 |
![]() ![]() Join Date: Aug 2005
Location: Bali
Posts: 11,216
|
![]() ok i put it online and sent using your email address , have a look in your inbox. ill delete it soon
![]()
__________________
If you're happy and you know it shake your meds! different style links examples Flight / Hotel search Free script download Bali Villas |
![]() |
![]() |
![]() |
#20 |
![]() Join Date: Feb 2006
Location: finland
Posts: 1,684
|
![]() nothing in my inbox or spam folder
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|