I am using a dynamic redirect to take vistors to the database stored
url as in this part of the script:
Expand|Select|Wrap|Line Numbers
- $sql = "SELECT ad_link FROM adverts WHERE advert_id = $N_ad_id";
- $result = mysql_query($sql) or die("could not execute find PRODUCTS query". mysql_error());
- $num = mysql_num_rows($result);
- if ($num == 0 ) {
- echo "There an ERROR in locating this product.";
- } // endif
- else{
- $row = mysql_fetch_assoc($result);
- $N_ad_link = "http://".$row["ad_link"];
- $sql = "UPDATE adverts SET click_cnt = click_cnt+1 WHERE advert_id = $N_ad_id";
- mysql_query($sql) or die("could not execute adverts update query". mysql_error());
- header("Location: $N_ad_link");
- exit();
index these links. Can I insert a bit of html code to accomplish this ?
EG
Expand|Select|Wrap|Line Numbers
- $sql = "UPDATE adverts SET click_cnt = click_cnt+1 WHERE advert_id = $N_ad_id";
- mysql_query($sql) or die("could not execute adverts update query". mysql_error());
- echo "
- <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
- \"http://www.w3.org/TR/html4/loose.dtd\">
- <html>
- <head>
- <title>Temp Page</title>
- <meta name=\"allow-search\" content=\"no\">
- <meta name=\"robots\" content=\"all, noindex, nofollow\">
- </head>
- <body>
- header(\"Location: $N_ad_link\");
- </body>
- </html>";
- exit();
echo statement.
Is the header(\"Location: $N_ad_link\"); in the correct place ?
Do you think this is the best way to do it ?
Thanks for any advice.
PS
Maybe I should use a meta-refresh instead:
So in the above html I will put:
Expand|Select|Wrap|Line Numbers
- echo "<html>
- <head>
- <title>Temp Page</title>
- <meta name=\"allow-search\" content=\"no\">
- <meta name=\"robots\" content=\"all, noindex, nofollow\">
- <meta http-equiv ='refresh' content = '0;url = $N_ad_link'>
- </head>
- <body>
- </body>
- </html>";