|
|
Jul 27, 2008 11:52:12 GMT
|
I know this probably isnt the right place to ask but i know theres a few coders here who may be able to help. I'm building the new Datsun owners club site and i cant seem to get a mailto form to work properley Ive tried a raw HTML one - but firefox don't like it. And ive done a PHP led one but nothing seems to bloomin' send to the address i specified. I've been online and tried a few 'free' ones to see if i can tweek them to work but no joy Anyone know any tips or can point me in the direction of an easy way to have a contact form on there?? Cheers
|
|
Your car is not 'epic', this thread is not 'epic'....the OCEAN is epic, the UNIVERSE is epic.... please stop misusing this word!! It would appear Hotrods are the new VWs - aint fashion funny! '69 BUICK LESABRE 350
|
|
Odin
Posted a lot
Posts: 1,406
|
|
Jul 27, 2008 19:25:34 GMT
|
How far have you got with the PHP one? That's the way I'd go. I did have one I made for a site ages ago, but I had a look and I don't seem to have it any more. I would have sent it to you otherwise. Edit: found it! It's one I got off a tutorial site that I tweaked so the target email address would be determined by a drop-down box, but that's easy to change back. <?
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ;
$mailto = '<?php echo ($_POST['subject']); ?>@' ;
// $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ;
$subject = "Online Form" ;
// the pages to be displayed, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "" ; $errorurl = "" ; $thankyouurl = "" ;
$uself = 0;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; }
if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); }
$messageproper =
"This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ;
?>
Hope that helps, the HTML side of things is reasonably easy to setup after reading some tutorials.
|
|
Last Edit: Jul 27, 2008 19:38:31 GMT by Odin
|
|
|
|
Jul 28, 2008 21:30:33 GMT
|
I had done a complete PHP one (friggin typed in full too ). But I'm so out of practise ive probably overlooked something stupid. My coding is so messy too, ashamedly so, but ill look through yours and maybe nick stuff out of it if thats okay?? Cheers man
|
|
Your car is not 'epic', this thread is not 'epic'....the OCEAN is epic, the UNIVERSE is epic.... please stop misusing this word!! It would appear Hotrods are the new VWs - aint fashion funny! '69 BUICK LESABRE 350
|
|
Odin
Posted a lot
Posts: 1,406
|
|
Jul 28, 2008 22:40:47 GMT
|
Yeah, no worries! I nicked the basic thing off somewhere to begin with anyway.
|
|
|
|