elros Posted June 4, 2007 Share Posted June 4, 2007 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!! Quote Link to comment https://forums.phpfreaks.com/topic/54159-help-with-login-that-populates-user-id-on-next-page/ Share on other sites More sharing options...
chigley Posted June 4, 2007 Share Posted June 4, 2007 <?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"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/54159-help-with-login-that-populates-user-id-on-next-page/#findComment-267743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.