Hello! my first code contribution for this website.
Introduction
I'm sure you all know those PTC sites where you click a link, need to wait for 30 seconds and get some money, right? well when you are viewing the ad you can not see the real url that actually get's loaded! I copied this idea for my own website using a sql database and some PHP!
What does it do?
Basically This script retrieves an url out of the sql database and places it into an I-frame, making the actual url invisible.
Why is this usefull?
- you hide the actual link.
- you can add a little note above the iframe.
- you can keep count of links hit on your website.
- its just a cool and fun thing to have!
The code
PHP Code:
<?php
include('functions.php');
if (isset($_GET['id']) && ctype_digit($_GET['id']))
{
DB_CONNECT();
$id = mysql_real_escape_string($_GET['id']);
$query = "SELECT * FROM websites WHERE id=$id LIMIT 1";
$result = mysql_query($query);
$gpt_site = mysql_fetch_assoc($result);
$query2 = "INSERT INTO linkout (parent_id,name,date,ip) VALUES ('$gpt_site[id]','$gpt_site[website_name]',now(),'$_SERVER[REMOTE_ADDR]')";
mysql_query($query2) or die(mysql_error());
?>
<html>
<head>
<style type="text/css">
* { margin:0px;}
</style>
</head>
<body style="margin:0px;">
<div style="height:50px;width:100%;border-bottom:1px solid black;background: url('Images/linkout.png') repeat-x;">
<img style="float:left;"src="Images/linkoutz.png" border="0" alt="Its appreciated if you signup as my referral!"/>
<p style="float:right;margin-right:15px;margin-top:10px;font-size:15px;"><a href="<?php echo $gpt_site['website_link']?>">Close Frame</a></p>
</div>
<iframe id="Frame" style="margin-top:10px;" src="<?php echo $gpt_site['website_link']?>" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="Yes" width="100%"></iframe>
</body>
</html>
<?php
}
easy!
If you want to see a live example, you can check out my website and click on the gpt site links
(intoffers)
Hope this was helpfull.