Forum Moderators: coopster

Message Too Old, No Replies

PHP/MySQL/Apache: using the php "mail( )" function

         

jd80

8:46 pm on Feb 14, 2004 (gmt 0)

10+ Year Member



I need a syntax check: here is my php action page for an html form with an input field asking for an email address... I'm trying to return a forgotten password to a given email address queried from a MySQL database. Here's the action page php code:

<?php
$email = htmlentities($_POST['email'], ENT_QUOTES);

$dbLink = mysql_pconnect("localhost", "root", "password");
mysql_select_db("theDB", $dbLink);

$Query = "Select fldPassword " . "From tblLogIn " . "where fldEmail = '$email'";
$dbResult = mysql_query("$Query",$dbLink);

$password = mysql_result($dbResult,0,"fldPassword");

mail("$email", "The information you requested", "$password");
?>

My operating system in Windows XP home edition and I'm running my own Apache 2.0 server and have used "sokkit" which is a combination of php, apache, and mysql to configure php, apache, and mysql. If anyone can help but needs more info, let me know. Thanks guys! 8)

georgiecasey

9:34 pm on Feb 14, 2004 (gmt 0)

10+ Year Member



what error is php throwing back?