Hey guys! I also have a question about how to autogenerate these types of links. (Pardon my tacky english)

What i am looking for is a way to autogenerate a "personal" och "unique" link for every user.

These unique links are suppose to point to "registration.php". The idea is that every time a person registrates from on one of these "personal" or "unique" links, the "owner" of the link should get a "point" for their "recruitment".

Was that understandable? :)

If i am correct the dilemma's are the following:

1. When a guy registrates he should get his unique link. It is suppose to be shown on the user profile.

2. Every time a person clicks on a users link he is suppose to be directed to the registration.php page.

3. When he has completed his registration via this "unique" link the user who the link "belongs to" is awarded a "point". (These points only has to be shown in the datebase)

How does this sounds?

Yes, it was infact in exactly that thread i first posted my question but it was moved to a new thread (this one). I did not found the answer there though, hehe

this is like a referral system if I'm not mistaken... to generate unique links to every user you has to give them their unique links by appending their id on the links, like http://www.yoursite.com/registration.php?id=13. through that after a successful registration you may be a able to identify who will be able to get the point. hope that helps ^_^

thanks mate! i acculy just got the unique link-generation to work perfectly!

this is the code:

$confirmcode = md5($_SESSION['myusername']);
$link ="registration.php?user=$username&conf=$confirmcode";


echo "<a href=\"$link\" target=\"mainFrame\">http://www.mysite.com/$link</a>";

The link generated looks like this:

www.mysite.com/registration.php?user=&conf=*************************

By some odd reason, when i tried to make the md5 encrytion more complex with a code looking like below, it generated the same hash for every user... very odd i must say

$confirmcode = md5($_SESSION['myusername'] + "sc00b13sc00b13d00");

By the way,, i was going to include the password in the encryption but seince a member can change his password i suppose that this would mean that a link generated before a passwordchange wouldnt work after the passwordchange. am i right?

anyway, how does the code look so far?

solved the trix with the more complex encryption just now, so just ignore that :)

right now it looks like this instead:

$salt="sc00b13sc00b13d00";
$confirmcode = sha1($salt.md5($_SESSION['myusername']));
$link ="registration.php?user=$username&conf=$confirmcode";
echo "<a href=\"$link\" target=\"mainFrame\">http://www.mysite.com/$link</a>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.