Jump to content

Recommended Posts

I'm trying to code a login for a site that will take a user's ID and then create a cookie with that ID.  And on the next page there will be links that I want to have that user's ID embed in.

 

 

For example:

 

On front page user puts in their User ID in input box - 000000

On second page text is generated with links that are updated with that User ID -www.mysite.com/refer/000000

 

Anyone know where I can get an example of how to do this or a tutorial?

 

Any help is much appreciated!!

<?php

$userid = $_COOKIE["userid"]; // Rename to your cookie name

$links = array("http://www.mysite.com/referer/[uSERID]", "http://www.anothersaite.com?referer=[uSERID]"); // An array, with [uSERID] where you want the userid to go

foreach($links as $link) {
$link = str_replace("[uSERID]", $userid, $link);
echo "<p>{$link}</p>\n\n";
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.