Hi,you said it yourself, the user has to submit the form. First create a HTML form. Within your form you will need to set the action to the page containing you PHP mail code. Something like
<form action="myform.php" method="post"> Next you can create the PHP page that contains your php mail code. Regards -- Markus On Dec 18, 2009, at 10:12 AM, Simon Mutama wrote:
Hi all, I am running a debian proxy server with dansguardian as a web content filtering system. If a user tries to visit a site and is blocked by dansguardian, the user is redirected to a page advising them what is occuring and with the option to request the site to be unblock via a form on the page. My problem is that when the user fills in and submits via the form, I do not get email as is supposed to happen. My code for the form is below. The page containing the form is saved as mailform.php in the folder /var/www/ Testing if php is successfully installed using a test page with the phpinfo() funtion is successful and I can send email via the command line mail command successfully. Any help with resolving this highly appreciated. Regards, Simon <html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = "Proxy unblock request" ; $message = $_REQUEST['site'] ;mail( "[email protected]", "Subject: $subject", $message, "From: $email" );echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "You must enter your full email address. Please press 'back' & try again"; } ?> </body> </html> <test.htm>_______________________________________________ LUG mailing list [email protected] http://kym.net/mailman/listinfo/lug %LUG is generously hosted by INFOCOM http://www.infocom.co.ug/The above comments and data are owned by whoever posted them (including attachments if any). The List's Host is not responsible for them in any way.---------------------------------------
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ LUG mailing list [email protected] http://kym.net/mailman/listinfo/lug %LUG is generously hosted by INFOCOM http://www.infocom.co.ug/ The above comments and data are owned by whoever posted them (including attachments if any). The List's Host is not responsible for them in any way. ---------------------------------------
