Need PHP SendMail form, then redirect to download page

MDLarson

Registered
OK, this is definately not my area of expertise, but a website I will be working on is running at least PHP version 4.0.18 (phpMyAdmin 2.5.6?). All I need is a PHP script that will run on this web server that...

A) has a user fill out their contact info (to be sent via email, or is there another method of archiving this data?) and...

B) directs the user to a specific web page featuring PDF downloads, etc.

I'm looking for a free PHP script... would this work? Am I in the right area here?
 
yeah, that would work for sending you an email.

However, all you really need is the mail() and header() commands.
Something as simple as "mail( $destination, $subject, $message ); header('location: $destination'); " would suffice for what it sounds like you need.
 
Sendmail (MailX) is not setup with PHP by default is it? I had to configure mine manually, but that way back in OS X 10.1.x, so maybe it is now.

To do a "redirect" in PHP you need to add a "location" header:
http://www.php.net/manual/en/function.header.php
PHP:
<?php
header("Location: http://" . $_SERVER['HTTP_HOST']
                     . dirname($_SERVER['PHP_SELF'])
                     . "/" . $relative_url);
?>

But note redirect headers can conflict with other headers like cookies, etc... So start simple.
 
Back
Top