Can't get it to send emails!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Posted: Mon Nov 24, 2003 2:09 am
Hi!
I have a script I have edited so that it sends emails. It allowed me to send emails on another page of the script but this page just WONT work!!! I have tried every way I know to send the email!! Heres the code:
Anything in the code that is stuffing it up?
I have a script I have edited so that it sends emails. It allowed me to send emails on another page of the script but this page just WONT work!!! I have tried every way I know to send the email!! Heres the code:
Code: Select all
<?php ob_start(); ?>
<?
session_start();
// Unset all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();
/*
if ($_GET('signup')) {
error("SIGNUP");
echo "Error Checking<br>";
while(list($name, $value) = each($signup)) {
echo "$name - $value<br>";
}
}
*/
require 'include.inc';
if ($signup) {
if ($signup[repassword] != $signup[password]) {
$err_msg = "Your passwords do not match.";
error($err_msg);
}
if(!eregi("^[_\.0-9a-z-]+$",$signup[username])) {
$err_msg = "Invalid Username! Usernames can consist of letters and numbers only.";
error($err_msg);
}
if(!eregi("^[_\.0-9a-z-]+$",$signup[password])) {
$err_msg = "Invalid Password! Passwords can consist of letters and numbers only.";
}
if(!$signup[password] || !$signup[username] || !$signup[email] || !$signup[username])
$err_msg = "Oops! You forgot some important fields!";
if (!$err_msg) {
// =================================================================
The Send Email Part
// =================================================================
@mail("webmaster@webmaster-resources101.com","hi","hessage","From: Surf2Ya <support@surf2ya.com>");
$time = time();
$usercheck = @mysql_query("INSERT INTO user values(
'NULL','$signup[fname]','$signup[lname]',
'$signup[username]','$signup[password]','$signup[email]', 1, ".$pointInc.", '$signup[referral]', '$time', 'n', 'y', '0', '0', '')") or die ("<b>Error:</b> ".mysql_error());
// done, you are entered correctly, Now Enter the points and URL info
$sql = "Select id from user where username='$signup[username]'";
$result = mysql_query( $sql );
if ( $result != false )
{
while ( $data = mysql_fetch_assoc( $result ) )
{
$point_set = $data['id'];
}
} else {
echo mysql_error();
}
// add rerral points
if ($signup[referral]) {
$referralSql="UPDATE points SET points=points+ ".$refPoints . " WHERE userid=".$signup[referral];
$result = mysql_query( $referralSql );
if ( $result != false )
{
} else {
echo mysql_error();
}
}
// add URL
$sql="INSERT INTO url_table ( userid, website, active, datechanged) VALUES ($point_set,'".$signup[site_url]."','n', '".date("Ymd")."')";
$result = mysql_query( $sql );
if ( $result != false )
{
} else {
echo mysql_error();
}
// add points
$sql="INSERT INTO points (userid, username, points) VALUES ($point_set,' ',$signPoints)";
$result = mysql_query( $sql );
if ( $result != false )
{
} else {
echo mysql_error();
}
}
echo mysql_errno().": ".mysql_error()."<br>";
include ("reg.php");
exit;
}
etc.. ect.. etc..
?>