|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems with Re-Direct from form to PHP script
I have a PHP-driven send mail script which gets its data from an HTML form
From what I can gather, the re-direct is not functioning properly PROBLEM *** When the user clicks the submit button the browser’s (any of them) URL windos changes to the form’s action (the PHP script) All of the data submitted through the form is sent along with formatting It’s just the user never gets re-directed. I have made sure that all of the CMOD settings are set to 777 The funny thing is I originally wrote the script and it still works on the site I did it for a year ago. Here’s the code for the PHP script: <?php /************************************************** * * PHP 4.1.0+ version of email script. ************************************************** */ // // $sendTo = "user@AOL.com"; $subject = "Your request from Design"; // // $headers = "From: " . $_POST["companyname"]; $headers .= "<" . $_POST["email"] .">rn"; // next include a Reply-To: $headers .= "Reply-To: " . $_POST["email"]; // // $message = $_POST["companyname"] ."rn"; $message .= $_POST["address"] ."rn"; $message .= $_POST["phone"] ."rn"; $message .= $_POST["email"] ."rnn"; $message .= $_POST["message"]; // // $redirect = "thanks.html"; mail($sendTo, $subject, $message, $headers); ?> Here’s the form code snippet: <form action="phpmail.php" method="post" enctype="multipart/form-data" name="form1"> <p> <input name="companyname" type="text" id="companyname4"> Company Name*</p> <p> <input name="address" type="text" id="address4"> Address <input type=hidden name="redirect" value="thanks.html"> </p> <p> <input name="phone" type="text" id="phone4"> Phone</p> <p> <input name="email" type="text" id="email4"> Email*</p> <p> <textarea name="message" id="textarea3"></textarea> Questions</p> <p> <input type="submit" name="Submit" value="Submit"> </p> <p> <input type="reset" name="Submit2" value="Reset"> </p> </form> Can this have anything to do with the fact that I have another form on my site of which the redirect = thanks.html (This is the re-direct page of the script that has the problem)? Would two re-directs to the same page render one of them inoperable? Any help on this issue is greatly appreciated |
|
#2
|
||||
|
||||
|
RE: Problems with Re-Direct from form to PHP script
<?php
/************************************************** * * PHP 4.1.0+ version of email script. ************************************************** */ // // $sendTo = "user@AOL.com"; $subject = "Your request from Design"; // // $headers = "From: " . $_POST["companyname"]; $headers .= "<" . $_POST["email"] .">rn"; // next include a Reply-To: $headers .= "Reply-To: " . $_POST["email"]; // // $message = $_POST["companyname"] ."rn"; $message .= $_POST["address"] ."rn"; $message .= $_POST["phone"] ."rn"; $message .= $_POST["email"] ."rnn"; $message .= $_POST["message"]; // //this is only assigning a variable $redirect = "thanks.html"; //mailing.. mail($sendTo, $subject, $message, $headers); //add this to redirect after complete header("Location: thanks.html"}; exit(); ?> |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Problems with Re-Direct from form to PHP script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|