require("members/generaldec.php");
require("/home/$teamusername/config.php3");
if ($_SERVER['REMOTE_ADDR'] == '192.0.201.105'){
echo "- bad";
}
$db = mysql_connect("$host", "$username", "$password");
mysql_select_db("$database",$db) or die ("Could Not Open $db: ".mysql_error() );
$testquery = mysql_query("select * from resellers where fldUser='$musername'") or die ("Could not add values to table:" .mysql_error() );
$test_row = mysql_fetch_array( $testquery );
if ($test_row[id] != '' ){
header("Location:http://www.womenwithdreams.com/errors.php?mode=taken");
} else {
$emailquery = mysql_query("select * from resellers where email='$email' and portal='$portal'") or die ("Could not add values to table:" .mysql_error() );
$email_row = mysql_fetch_array( $emailquery );
if ($email_row[active] == '1' ) {
header("Location:http://www.womenwithdreams.com/errors.php?mode=dup");
} elseif ($email_row[active] == '0' ) {
$date = date("D. M jS, Y g:i A");
$result = mysql_query("UPDATE resellers SET fldUser='$musername', fldPass='$mpassword', active='1', dateActivated='$date EST' WHERE id='$email_row[id]'")
or die ("Could not add values to table:" .mysql_error() );
$to = "$email";
$subject = "Your site has just been activated!";
$body = "Your site has just been activated!
your username and password are as follows:
Username: $musername\nPassword: $mpassword
Click here to login: http://www.womenwithdreams.com/members/";
$headers = "From: $refferer";
$numSymbols1 = substr_count($headers, "@");
## do not allow injection in To or Headers - if injection is attempted ... die
if (eregi("\r",$to) || eregi("\n",$to) || eregi("\r",$headers) || eregi("\n",$headers)){
die("Why ??");
}
if ($numSymbols1 <= 1){
mail($to,$subject,$body,$headers);
$emailSent = true;
}
} elseif ($email_row[id] == '') {
$date = date("D. M jS, Y g:i A");
$SQL = "insert into resellers (name,telephone,email,city,province,country,refferer,fldUser,fldPass,active,dateAdded,dateActivated) values ('$firstname $lastname','$telephone','$email','$city','$prov','$country','$refferer','$musername','$mpassword','1','$date','$date')";
$result = @mysql_query($SQL) or die("could not complete your query");
$to = "$email";
$subject = "Your site has just been activated!";
$body = "Your site has just been activated!
your username and password are as follows:
Username: $musername\nPassword: $mpassword
Click here to login: http://www.womenwithdreams.com/members/";
$headers = "From: $refferer";
$numSymbols1 = substr_count($headers, "@");
## do not allow injection in To or Headers - if injection is attempted ... die
if (eregi("\r",$to) || eregi("\n",$to) || eregi("\r",$headers) || eregi("\n",$headers)){
die("Why ??");
}
if ($numSymbols1 <= 1){
mail($to,$subject,$body,$headers);
$emailSent = true;
}
}
if ($portal == '0') {
$list = '12';
} else {
$list = '13';
}
header("Location:http://www.responsemagic.com/signup.php?frmFirst=$firstname&frmLast=$lastname&frmEmail=$email&frmPhone=$telephone&frmUser=wwdreams10&frmList=$list&frmFromEmail=founders@womenwithdreams.com&frmURL=http://www.womenwithdreams.com/active.html");
}
?>