I have a host that will not allow me to use the mail() function in PHP scripts. He has his own ColdFusion script that he wants me to submit form information to. The problem is that this bypasses all the error checking of the form since the form is written as a self submitting form. I don't want to use javascript for error checking as 10% of browsers have it turned off.
Is there a way for me to salvage my self submitting form by replacing the mail() function with a header() function that would neatly look like it was submitted by my original form? IF this can be done what would the header look like?
Thanks,
Eric
How to send a post header programatically
Moderator: General Moderators
It should work. Get the $_POST array values, and transfer it within the URI might be on idea. Not perhaps correct, but you get the ideas:
...then base54_decode and unserialize the $_GET['postinfo'] being sendt in theotherpage.php.
There is also cURL() to name something else.
Code: Select all
// ... code ...
// mail(...);
foreach ($_POST as $key => $val) {
$array[$key] = $val;
$string = base64_encode(serialize($array));
header("Location: ./theotherpage.php?postinfo={$string}");
}There is also cURL() to name something else.
a little tip is otherwise to use some other class, there is a neat bunch of classes (SMTP/mail) which sends a message equally to the internal mailfunction... there is probably a functiondefinition somewhere which works just like mail() too.
(let's you specify everything the way you want with possibly full errorchecking)
(let's you specify everything the way you want with possibly full errorchecking)