Reply to Re: PHP form processor

Your name:

Reply:


Posted by Toby Inkster on 02/05/06 18:50

Paul Watt wrote:

> Can anyone recommend a good PHP form processor? Basically I want to design a
> form and have the results sent to a php script to email back to me.

For the most part, PHP form to mail stuff is so easy that it's not worth
using a third-party one.

e.g.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>PHP Mail Example</title>
<h1>PHP Mail Example</h1>
<?php
$myaddress = 'me@example.org';
$mysubject = 'Feedback from website';

if ( isset($_POST['message']) )
{
$mymessage = "IP: {$_SERVER['REMOTE_ADDR']}\r\n"
. "Browser: {$_SERVER['HTTP_USER_AGENT']}\r\n\r\n"
. stripslashes($_POST['message']);

if (@mail($myaddress, $mysubject, $mymessage))
print "<p>Mail send successfully!</p>\n";

else
print "<p>Failed! Please try again later.</p>\n";
}
?>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<div>
<textarea rows=10 cols=60 name="message"></textarea>
<br>
<input type="submit" value="Send Mail">
</div>
</form>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация