Jump to content

Help with login that populates user ID on next page


elros

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";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.