tawevolution Posted November 29, 2006 Share Posted November 29, 2006 Is there anyway to get information from a cookie, and have it displayed in the url (www.e.g.com/index.php?cookie=content)? Link to comment https://forums.phpfreaks.com/topic/28847-_get-and-cookies/ Share on other sites More sharing options...
taith Posted November 29, 2006 Share Posted November 29, 2006 as far as i know... only by putting it there[code]<a href="#?op=<?=$_COOKIE[var]?>">[/code] Link to comment https://forums.phpfreaks.com/topic/28847-_get-and-cookies/#findComment-132039 Share on other sites More sharing options...
alpine Posted November 29, 2006 Share Posted November 29, 2006 On php5 you can extract all cookies and generate an URL-encoded query string like this:[code]<?phpecho "<a href='www.blah.com/read.php?".http_build_query($_COOKIE)."'>LINK</a>";?>[/code]And for one cookie value alone, [code]<?phpecho "<a href='www.blah.com/read.php?".$_COOKIE['the_cookie_name']."'>LINK</a>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/28847-_get-and-cookies/#findComment-132134 Share on other sites More sharing options...
tawevolution Posted November 29, 2006 Author Share Posted November 29, 2006 [quote]<?phpecho "<a href='www.blah.com/read.php?".$_COOKIE['the_cookie_name']."'>LINK</a>";?>[/quote]That is what i though of doing, just wanted any other ideas. THANKS xDOh, also, I know to send the data (Form method=get) how do i put that into a link (instead of a form). so click on an image link, which goes to www..com/index.php?lang=en Link to comment https://forums.phpfreaks.com/topic/28847-_get-and-cookies/#findComment-132175 Share on other sites More sharing options...
alpine Posted November 30, 2006 Share Posted November 30, 2006 Pardon ? Those are links provided - Or please explain further Link to comment https://forums.phpfreaks.com/topic/28847-_get-and-cookies/#findComment-132593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.