javascript - Form Redirect Success/Fail page -
javascript - Form Redirect Success/Fail page -
i have tried create form redirect success or fail page. have searched through internet, looking @ normal form redirects , javascript onclick redirect's. can help me add together adding redirect:
html:
<!-- ///////////////////////////////////////////////////////////////////////////////// --> <!-- contact form --> <div class="col-lg-6"> <h1>contact</h1> <h3 class="service_h3">say hello! inquire something?</h3> <form action="submit_contact.php" id="contactform"> <fieldset> <div id="result"></div> <!-- ///////////////////////////////////////////////////////////////////////////////// --> <!-- name field --> <div class="form-item"> <label for="name"> <input type="text" name="name" id="name" placeholder="enter name" required/> </label> </div> <!-- ///////////////////////////////////////////////////////////////////////////////// --> <!-- email field --> <div class="form-item"> <label for="email"> <input type="email" name="email" id="email" placeholder="enter email" required/> </label> </div> <!-- ///////////////////////////////////////////////////////////////////////////////// --> <!-- message field --> <div class="form-item"> <label for="message"> <textarea name="message" id="message" placeholder="your message" required></textarea> </label> </div> <!-- ///////////////////////////////////////////////////////////////////////////////// --> <!-- submit button --> <div class="form-item"> <button name="submit" class="submit_btn" action="submit_contact.php" window.open("done") type="submit">submit</button> </div> </fieldset> </form> </div>
php:
<?php /* subject , email variables*/ $emailsubject = 'contact form submission'; $webmaster = 'no-reply@*hidden*.com'; /* gathering info variables */ $namefield = $_post['name']; $emailfield = $_post['email']; $messagefield = $_post['message']; $ip = $_server['remote_addr']; $hostaddress = gethostbyaddr($ip); $browser = $_server['http_user_agent']; $referred = $_server['http_referer']; $body = <<<eod <br><img src="*hidden*"> <br>goaerox! network - contact form submission<hr><br> <strong>name:</strong> $namefield <br> <strong>email:</strong> $emailfield <br> <strong>message:</strong> $messagefield <br><br> <hr><br><strong>user details</strong><br> <strong>ip address:</strong> $ip <br> <strong>host address:</strong> $hostaddress <br> <strong>browser:</strong> $browser <br> <strong>referred:</strong> $referred <br> eod; $headers = "from: $emailfield\r\n"; $headers .= "content-type: text/html\r\n"; $success = mail($webmaster, $emailsubject, $body, $headers); /* results rendered html */ $theresults = <<<eod <html> **result page** </html> eod; echo "$theresults"; ?>
please give reply read amatuer php coder. note: happy redirect page or popup on actual contact page. long user can see form has been submitted without error.
you can utilize next code redirect success or fail page
<?php $emailsubject = 'contact form submission'; $webmaster = 'no-reply@*hidden*.com'; $namefield = $_post['name']; $emailfield = $_post['email']; $messagefield = $_post['message']; $ip = $_server['remote_addr']; $hostaddress = gethostbyaddr($ip); $browser = $_server['http_user_agent']; $referred = $_server['http_referer']; $body = <<<eod <br><img src="*hidden*"> <br>goaerox! network - contact form submission<hr><br> <strong>name:</strong> $namefield <br> <strong>email:</strong> $emailfield <br> <strong>message:</strong> $messagefield <br><br> <hr><br><strong>user details</strong><br> <strong>ip address:</strong> $ip <br> <strong>host address:</strong> $hostaddress <br> <strong>browser:</strong> $browser <br> <strong>referred:</strong> $referred <br> eod; $headers = "from: $emailfield\r\n"; $headers .= "content-type: text/html\r\n"; $success = mail($webmaster, $emailsubject, $body, $headers); header('location:success.php'); ?>
javascript php jquery html redirect
Comments
Post a Comment