PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This is the idea:
Someone clicks on the link that will take him/her outside of my site to another site.
All I need is for PHP to record this click on the link and insert it in the DB with the sql code menthioned above
<?php
if(!empty($_GET['x'])){
//connect to mysql
$sql = "UPDATE table_name SET clicks = clicks+1 WHERE id = {$_GET['id']}";
mysql_query($sql);
$sql2 = "SELECT url FROM table_name WHERE id = {$_GET['id']}";
$url = mysql_result(mysql_query($sql2),0,0);
header("Location: ".$url);
}
else {
echo "Error..";
}
?>
Last edited by d3ad1ysp0rk on Tue Jun 15, 2004 3:38 pm, edited 2 times in total.
yea, you need to keep in mind that for php to do anything it has to do it serverside, and the only way to do what you want to do with php would to do as Mr. lilpunkSkater said, have a inbetween page.....