Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,536 members, 7,823,328 topics. Date: Friday, 10 May 2024 at 08:50 AM

MikdadAli's Posts

Nairaland Forum / MikdadAli's Profile / MikdadAli's Posts

(1) (of 1 pages)

Webmasters / Re: How To Create An Autoresponder In An Html Form by MikdadAli: 6:23am On Dec 30, 2015
xclusiv:
to auto respond to create an autoresponder in php

you can add a form function to the form with the form action directed at another page, then u can use the following php script to create the autoresponder, note that you will need to create a separate HTML Page that will hold the autoresponder message

<html>
<head>
<title>page title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>

<?php
/* Code Developed by Abiodun Ogunibe. Copyright 2007. All Rights Reserved*/

/* subject */
$subject = "Feedback Form Submission, with autoresponder.";

/* message */
$message='The following information were submitted on ' . date("F j, Y, g:i a"wink . ' through the feedback form' ."\r\n".
'==============================================================='."\r\n".
/*the variable name in the POST[] title depends on the name u give ur form field*/
'Title: ' . $_POST[title] . "\r\n".
'First Name: ' . $_POST[firstname] ."\r\n".
'Surname: ' . $_POST[surname] ."\r\n".
'Position: ' . $_POST[position] ."\r\n".
'Company: ' . $_POST[company] ."\r\n".
'Address: ' .$_POST[address] ."\r\n".
'Tel: ' .$_POST[phone] ."\r\n".
'E-mail: ' .$_POST[email] ."\r\n".
'Comments: ' .$_POST[message] ."\r\n".
'======================SYSTEMS DETAILS=========================='."\r\n".
'IP: '.$_SERVER[REMOTE_ADDR] ."\r\n".
'User Agent: '.$_SERVER[HTTP_USER_AGENT]."\r\n";

/* Send Reply to E-Mail <strong></strong>*/
$headers = "From: " . $_POST[email]. "\r\n";
mail("info@yourwebsite.com", $subject, $message, $headers);

$message = '<font size="2" face="Arial, Helvetica, sans-serif">'.'Dear ' . $_POST[name] . ',' . '<p></p>';
/*the feedback.html is the autoresponder that u want to send*/
$message .= implode ('', file ('feedback.html'));

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Your Company's Name <info@yourwebsite.com>\r\n";

/* and now mail it */
$subject = "Your Comment/Question.";
mail($_POST[email], $subject, $message, $headers);

?>

<script>
window.location="contact_reply.html"
</script>

</body>
</html>

save the message as .PHP and reference the page using the form action control, if u use formfield in HTML


not working got systax error pls help me

(1) (of 1 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.