Code: Select all
session_start();
include("functions_main.inc");
$table_name = "Customer";
$next_program = "SecretPage.php";//occurance 1Code: Select all
if($num == 1)
{
$sql = "SELECT user_name FROM $table_name
WHERE user_name='$_POST[fusername]'
AND password=md5('$_POST[fpassword]')";
$result2 = mysqli_query($cxn,$sql)
or die("Couldn't execute query 2.");
$row = mysqli_fetch_assoc($result2);
if($row)
{
$_SESSION['auth']="yes";
$_SESSION['logname'] = $_POST['fusername'];
header("Location: $next_program");//occurance 2
}
else
{
$message_1="The Login Name, '$_POST[fusername]'
exists, but you have not entered the
correct password! Please try again.<br>";
extract($_POST);
include("fields_login.inc");
include("double_form.inc");
}
}Code: Select all
else
{
$today = date("Y-m-d");
$fields_str = implode(",",$fields);
$values_str = implode('","',$values);
$fields_str .=",create_date";
$values_str .='"'.",".'"'.$today;
$fields_str .=",password";
$values_str .= '"'.","."md5"."('".$password."')";
$sql = "INSERT INTO $table_name ";
$sql .= "(".$fields_str.")";
$sql .= " VALUES ";
$sql .= "(".'"'.$values_str.")";
mysqli_query($cxn,$sql) or die(mysqli_error($cxn));
$_SESSION['auth']="yes";
$_SESSION['logname'] = $user_name;
/* send email to new Customer */
$emess = "You have successfully registered. ";
$emess .= "Your new user name and password are: ";
$emess .= "\n\n\t$user_name\n\t";
$emess .= "password\n\n";
$emess .= "We appreciate your interest. \n\n";
$emess .= "If you have any questions or problems,";
$emess .= " email service@ourstore.com";
$subj = "Your new customer registration";
#$mailsend=mail("$email","$subj","$emess");
header("Location: $next_program");//occurance 3
}also this line from the tutorial is commented out(i didnt notice it was until after i posted)
Code: Select all
$mailsend=mail("$email","$subj","$emess");Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\bla\bla\bla\PHP\Login.php on line 204
Warning: Cannot modify header information - headers already sent by (output started at C:\bla\bla\bla\PHP\Login.php:204) in C:\bla\bla\bla\PHP\Login.php on line 205
and here is the funny thing about it all....the username saves in the database....so the information is saving and everything works perfectly...the only problem is when i try to shoot the email to the customer i get that error....does anyone know why?