www.amazon.com
to
www.techrebate.com/go.php?id=34
It installed fine, but once I click on my newly made links in postnuke, it has an error like this:
Code
Warning: mysql_free_result(): supplied argument is not a valid mysql result resource in /home/techreba/public_html/go.php on line 77
Warning: mysql_close(): supplied argument is not a valid MySQL-link resource in /home/techreba/public_html/go.php on line 78
Warning: mysql_close(): supplied argument is not a valid MySQL-link resource in /home/techreba/public_html/go.php on line 78
So... naturally I went back into the script go.php, which looks like this:
Code
/********************************************
data capture section - server variables
*********************************************/
$linkid=$_GET['id'];
$visitorip= $_SERVER['REMOTE_ADDR'];
$visitorurl= $_SERVER['HTTP_REFERER'];
$visitorbrowser= $_SERVER['HTTP_USER_AGENT'];
$visitorpage=$_SERVER['REQUEST_URI'];
/********************************************
upload the data into the database
*********************************************/
$insertquery="INSERT INTO stats (ip,url,browser,date,page,linkid,sitecode) VALUES ('$visitorip','$visitorurl','$visitorbrowser',NOW(),'$visitorpage',$linkid,'$sitecode')";
// echo $insertquery;
$result=mysql_query($insertquery) or die(mysql_error());
/********************************************
redirect the user
*********************************************/
$sqlredir="SELECT * FROM redirs WHERE id=$linkid";
$rdresult=mysql_query($sqlredir) or die(mysql_error());
$row=mysql_fetch_assoc($rdresult) or die(mysql_error());
$rdurl="Location: ".$row['redirect'];
header($rdurl);
/********************************************
shut down the SQL connection and flush
*********************************************/
mysql_free_result($rdresult);
mysql_free_result($result);
$goodbye=mysql_close($conn);
data capture section - server variables
*********************************************/
$linkid=$_GET['id'];
$visitorip= $_SERVER['REMOTE_ADDR'];
$visitorurl= $_SERVER['HTTP_REFERER'];
$visitorbrowser= $_SERVER['HTTP_USER_AGENT'];
$visitorpage=$_SERVER['REQUEST_URI'];
/********************************************
upload the data into the database
*********************************************/
$insertquery="INSERT INTO stats (ip,url,browser,date,page,linkid,sitecode) VALUES ('$visitorip','$visitorurl','$visitorbrowser',NOW(),'$visitorpage',$linkid,'$sitecode')";
// echo $insertquery;
$result=mysql_query($insertquery) or die(mysql_error());
/********************************************
redirect the user
*********************************************/
$sqlredir="SELECT * FROM redirs WHERE id=$linkid";
$rdresult=mysql_query($sqlredir) or die(mysql_error());
$row=mysql_fetch_assoc($rdresult) or die(mysql_error());
$rdurl="Location: ".$row['redirect'];
header($rdurl);
/********************************************
shut down the SQL connection and flush
*********************************************/
mysql_free_result($rdresult);
mysql_free_result($result);
$goodbye=mysql_close($conn);
The lines 77 and 78 are the last 2 lines of the code
Code
Any body have any ideas? Thanks for your time
Glen