I have installed a redirect script "goredirect" that changes outboud urls like
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:
Warning:
mysql_free_result(): supplied argument is not a valid
mysql result resource in /home/techreba/public_html/go.php on line
77Warning:
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:
/********************************************
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
Any body have any ideas? Thanks for your time
Glen