hi again
thanks for putting your code 🙂
Yeah, you have posted the right php code. Well done!
first, a general remark, on Having Text/Link displayed on Redirect page:
If i was you, I should KEEP it as it is.
you know in IE7 or any other Browser, there is a setting:
Enable / Disable META REFRESH ..... rdirects
Suppose some person want s have control over where sex-sites redirects him.
So he has turned this OFF.
What will happen is, he will not be redirected AUTOMATICALLY.
In this case WE SHOULD HAVE a link displayed, or some information at least.
You will be redirected in x seconds to this URL.
If not, Please click this LINK.
If you still ,after my mini-tutorial 😃,
wants to take away the information about Redirect:
then
you can Block Out the part of PHP code that displays message:
Using
/*
this
is not executed
*/
So here is the new code .. if you decide go for it:
//////////////////////////////////////////////////////////////////////
// redirection related processing (case where preview_on set to "N")
//////////////////////////////////////////////////////////////////////
if(!strstr($_SERVER['QUERY_STRING'], "act") &&
!strstr($_SERVER['QUERY_STRING'], "page") &&
$_SERVER['QUERY_STRING'] != "" &&
$preview_on != "Y") {
print "<link href=\"./style/styles.css\" rel=\"stylesheet\" type=\"text/css\">";
mysql_connect($db_host, $db_login, $db_pwd) or die("Cannot connect to DB!");
mysql_select_db($db_name) or die("Cannot select DB!");
$sql = "select target_url from bs_recs where " .
"seed = '" . fnpreparesql($_SERVER['QUERY_STRING']) . "'";
$rst = mysql_query($sql);
if(mysql_affected_rows() > 0) {
$row = mysql_fetch_array($rst);
print "\n<script language=\"javascript\" type=\"text/javascript\">\n";
print "<!--\n";
print "window.setTimeout('window.location=\"" . $row['target_url'] . "\";', " . ($redir_delay * 1000) . ");\n";
print "//--></script>\n";
/*
print "<div class=\"okmsg\">";
print "<br>Redirecting to target page.<br>" .
"If redirect does not happen within " . $redir_delay . " seconds, please click on the link " .
"below.<br><br>";
print "<a href=\"" . $row['target_url'] . "\">" . $row['target_url'] . "</a>";
if($redir_delay > 1) {
print "<br><br><br><br><br>";
print "While waiting for be redirected, we would like to take this opportunity to inform you about: <br><br>";
print $advert_html;
print "<br><br>";
*/
}
print "</div>";
}
else {
print "<div class=\"errmsg\">";
print "<br>Error: Invalid target URL!<br><br>";
print "</div>";
}
mysql_close();
exit();
}