*Hiding links* tutorial

gptsven

New Member
Messages
253
Reaction score
5
Points
0
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:
<?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.
 

vol7ron

New Member
Messages
434
Reaction score
0
Points
0
My site (found in my future sig when it's finally done) will expand on this idea, only I'll make it search engine friendly.
 
Last edited:

cursedpsp

New Member
Messages
237
Reaction score
0
Points
0
I dont understand why we would need it?

just do

Code:
<span style="display: none;"><a href="http://example.com">...

if you want to hide links?

And this isnt actually much of a tutorial? More of a snippet of code.

Also:
32.png
- there are many hitcounter gens on the web (like my site :))
 
Last edited:

gptsven

New Member
Messages
253
Reaction score
5
Points
0
its... a tutorial cause im explaining you how to do something.
the reasons why you could use it are explained above.

i don't want to use a span. thats not the idea. and I dont want no pure HTML. I want it to be dynamic
 

Soki

Banned
Messages
857
Reaction score
1
Points
0
What edits are needed? Can you explain a little more. If it needs MySQL then where do we put the database name and stuff?

Whats the point of "hiding" links?

So they don't download your stuff that you don't want other to download or find out your folders or to stop hackers from finding ways through your files.
 

gptsven

New Member
Messages
253
Reaction score
5
Points
0
Whats the point of "hiding" links?
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!

it was in the first post...
first of all you can make a TABLE where you count every "hit-out" on your website. this is very interesting to find out how your site is doing. suppose you have an affiliate link on your webpage(an ad where you get money for referred sales or members.) or even a referral link for some gpt-site, you can then COUNT the number of times a visitor has hit that link and COMPARE it with howmany signups you actually received! isnt that just interesting data to know?. it also gives details about how interesting a certain advertisement or given link seems for other people. supose you have first had just placed a single textlink. you then upgrade that link to textlink + image + little discription or detailed description. you can than evaluate how much you gained by doing that! this helps you thinking about more changes you can perform on your website to get more out of it.

_________________________________________________

second of all. ITS EASY! You have one table with ALL links on your website + another table where its stated howmany times the links get visited. PLUS supose a websites URL has changed and you have the url in multiple articles or on multiple pages. just replace the URL in the database ONE time instead of replacing them on each and every single html-page.

This script is to show you how to keep track of things. if you dont want to put the link in an Iframe with a little note or add ontop... then dont! :) I just made it like that so i can add a little note or ad, or whatever to it makes my site about gpt sites look far more proffessional than others, cause most people just have plain HTML sites or blogs without anything special where they just place html links to gain referrals...

if you need more info id be happy to give you some.


What edits are needed? Can you explain a little more. If it needs MySQL then where do we put the database name and stuff?



So they don't download your stuff that you don't want other to download or find out your folders or to stop hackers from finding ways through your files.

you just connect to your database ...
I wrote a function for it:
DB_CONNECT (); so i do not need to repeat these lines
mysql_connect("localhost","username","password");
mysql_select_db("databasename");

hundreds of times in my webscript ....
thats the use of a function ... a part of code you have a lot in the parts of your website, put em in a function and your code looks much cleaner, easier to read etc...
 

Max1337

New Member
Messages
268
Reaction score
0
Points
0
There is always a way to find out the link to a website.
Lol.
But still, good tutorial.
 

gptsven

New Member
Messages
253
Reaction score
5
Points
0
There is always a way to find out the link to a website.
Lol.
But still, good tutorial.

keep in mind that people are lazy. they do not want to open a new tab, surf to google and type in a related item for the link. :)
 

hcse26

New Member
Messages
94
Reaction score
0
Points
0
Well without even testing this but reading your code, it has this:

include('functions.php');

and you didn't include the source of functions.php.

In other words, the script will just result in an error because it's going to be looking for 'functions.php' which is not there....
 

gptsven

New Member
Messages
253
Reaction score
5
Points
0
Well without even testing this but reading your code, it has this:



and you didn't include the source of functions.php.

In other words, the script will just result in an error because it's going to be looking for 'functions.php' which is not there....

so just delete include('functions.php'); obvious LOL

if you would know anything about PHP you would see I only used 2 Functions in that script, named DB_CONNECT(); and DB_DISCONNECT(); . guess what those do... if you cant even figure something like that out you cant install the script either.
 
Last edited:

hcse26

New Member
Messages
94
Reaction score
0
Points
0
so just delete include('functions.php'); obvious LOL

if you would know anything about PHP you would see I only used 2 Functions in that script, named DB_CONNECT(); and DB_DISCONNECT(); . guess what those do... if you cant even figure something like that out you cant install the script either.


So if it was so obvious that you would delete it, then why include a PHP script that won't exist [nor need it] when you run it? :nuts:

If you took that earlier post about your code as an insult, well it's not pal. It's something called constructive criticism.

Learn how to take it positively, not hate it because it seems negative.:cool:
 

gptsven

New Member
Messages
253
Reaction score
5
Points
0
So if it was so obvious that you would delete it, then why include a PHP script that won't exist [nor need it] when you run it? :nuts:

If you took that earlier post about your code as an insult, well it's not pal. It's something called constructive criticism.

Learn how to take it positively, not hate it because it seems negative.:cool:


It exists in my files. don't act like a whiner
 
Top