Jump to content

No error logs, and nothign showing in the browser


ballhogjoni

Recommended Posts

I can't figure out what is wrong with this script. For some reason it is not writing the info to the db and not redirecting to the page in the header(). I check error logs, and in the browser it just echo's the request on line one. Can anyone help me figure this out?

 

<?php
echo $_REQUEST['from'];

$db_server = "localhost";	//mysql server. eg: mysql.domain.com
$db_password = "xxxxxxxx";			//mysql password
$db_name = "xxxxxxxx";		//mysql database name
$db_user = "xxxxxxxxxx"; 	//mysql user name

mysql_connect($db_server,$db_user,$db_password) or die(mysql_error());
@mysql_select_db($db_name) or die(mysql_error());

$result = mysql_query("SELECT subs FROM tracking_refs WHERE email = '".$_REQUEST['from']."'") or die(mysql_error());
$row = mysql_num_rows($result) or die(mysql_error());
print_r($row);
echo "<br>";
$rowInfo = mysql_fetch_array($result) or die(mysql_error());
print_r($rowInfo);
echo "<br>";
$count = $rowInfo['subs'] + 1;
echo $count;

if ($row >= 1) {
mysql_query("UPDATE tracking_refs SET subs = '".$count."' WHERE email = '".$_REQUEST['from']."'") or die(mysql_error());
header("location:http://xxxxxxxxxxxxxxx");
} else {
mysql_query("INSERT INTO tracking_refs (email,subs) VALUES ('".$_REQUEST['from']."','1')") or die(mysql_error());
header("location:http://xxxxxxxxxxxxxxxxxxxxxxxxx");
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.