Example:
Database Entry:
ID: 1
Site URL: http://www.d-frame.co.uk
Count: 0
When a link is clicked (example: clicks.php?id=1) it goes to http://www.d-frame.co.uk, but i only know how to do that with a frame type thing, because i have the top frame window holding the count script and the bottom table window as the table that actually views the site. So what i want to know is how do i get it so when i click the link it sends them to the site that they clicked for but still it counts it in the database without any frames being involved?
Here is an example of the code i have:
index.php
Code: Select all
<a href="./clicks.php?id=1" target="_blank">D-Frame</a>Code: Select all
<?
mysql_pconnect("localhost","dale","*****") or die(mysql_error());
mysql_select_db("dale1") or die(mysql_error());
$query = "SELECT * FROM site_links WHERE id=".$_GET['id']."";
$result = mysql_query($query) or die(mysql_error());
while($r=mysql_fetch_array($result))
{
$siteurl=$r["siteurl"];
echo "<html>
<head>
<title>Going Away</title>
</head>
<frameset rows="90,*" framespacing="0" border="0" frameborder="0" frameborder="no" border="0">
<frame src="count.php" name="menu" scrolling="no" NORESIZE frameborder="0" marginwidth="0" marginheight="0" border="no">
<frame src="$siteurl" name="main" scrolling="auto" NORESIZE frameborder="0" marginwidth="0" marginheight="0" border="no">
</frameset>
</html>";
}
?>Code: Select all
<?
mysql_pconnect("localhost","dale","*****") or die(mysql_error());
mysql_select_db("dale1") or die(mysql_error());
$query = "UPDATE site_links SET count=count+1 WHERE id=".$_GET['id']."";
$result = mysql_query($query) or die(mysql_error());
?>(PS; Sorry if in wrong room!)