someone please help me out
i run the scipt and it does nothing. no database interaction and no mailing and no nothing. i dont even get php or mysql error. i am going crazy. this is a little newsletter script i am working on. very simple but ultra efective.
<?php
// ChsFew.com Newsletter System
// addusr.php
// Add new user
//MySQL connection; Put your info.
$db_host = 'localhost'; // Where is the server ex. localhost , 127.0.0.1
$db_user = 'user'; // Whats the MySQL server username
$db_pass = 'pass'; // Whats the MySQL server password
$db_data = 'database'; // Whats the MySQL server database name
// Do not edit bellow this line!
//SQL server connection
$link = mysql_connect($db_host,$db_user,$db_pass);
if(!$link){echo 'error1 '.mysql_error();exit;}else{echo 'ok1<p>';}
$con1 = mysql_select_db($db_data);
if(!$con1){echo 'error2 '.mysql_error();exit;}else{echo 'ok2<p>';}
// Add user to out list
$query = 'INSERT INTO `database`.`subs` VALUES (NULL, \''.stripslashes($_POST['fname']).'\', \''.stripslashes($_POST['lname']).'\', \''.stripslashes($_POST['emailaddy'])'\', \''.stripslashes($_POST['class']).''\');';
$result = mysql_query($query,$link);
IF(!$result){
echo '<H1><b>That email is already in our list. You will now be redirected to our homepage!</b></H1><p> '.mysql_error();exit;
}ELSE{
// Email new user a welcome message
$header = "MIME-Version: 1.0rn";
$header .= "Content-type: text/html; charset=iso-8859-1rn";
$header .= "FROM --- companyname - newsletter@some.com\r\n";
$mail = mail(stripslashes($_POST['emailaddy']), 'Thanks for joining the company name newsletter',
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<p>
Dear '.stripslashes($_POST['fname']).' '.stripslashes($_POST['LNAME']).',</p>
<p>some text.</p>
<p>more text</p>
<p>
Newsletter Staff<br >
company<br >
www.SoMe.com<br ><a
href="mailto:newsletter@some.com">newsletter@some.com</a>
<br ></p>
<p>
** This email was sent by request if you would like to
unsubscribe to this email <a
href="http://some.com/newsletter/unsub.php?emai='.stripslashes($_POST['emailaddy']).'">CLICK HERE</a> and you
will be removed from our list.</p>
</font>
</body>
</html>',$header);
if(!$mail){echo 'error3';exit;
}
echo '<H1><b>Thanks you for joining the list. You will now be redirected to our homepage!</b></H1>';
header("Location: http://some.com/")
}
?>