SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2014
    0 Post(s)
    0 Thread(s)

    Question PHP & COOKIES (If $_cookie = then this)

    Hello, i was woundering if you are able to help me on a puzzle i dont quite understand.

    Here is my code:
    PHP Code:
    if (($_COOKIE['talent_user_email_address']) == '*****@*****'){    
    '<div id="left_actions" class="tabInactive" onclick="window.location.href=\''.$this->root.'Log_An_Invoice#View_An_Invoice\';" onmouseover="document.getElementById(\'left_actions\').className=\'inactiveTabOver\';document.getElementById(\'right_actions\').src=\''.$this->root.'images/gui/tab_right_over.gif\';" onmouseout="document.getElementById(\'left_actions\').className=\'tabInactive\';document.getElementById(\'right_actions\').src=\''.$this->root.'images/gui/tab_right_inactive.gif\';"><span><b>View An Invoice</b></span><img id="right_actions" src="'.$this->root.'images/gui/tab_right_inactive.gif" /></div>';    
            } else {} 
    im woundering if i can retrieve a cookie from a login then be able to read it and display a certain tab specific to that one user. for example

    PHP Code:
     if $_COOKIE['talent_user_email_address'] == '*****@*****' 
    then echo the specific tab else if not dont display the specific tab

    help please
    Last edited by Mittineague; Jun 18, 2014 at 11:30. Reason: Please keep personal info private

  2. #2
    SitePoint Addict bronze trophy vectorialpx's Avatar
    Join Date
    Dec 2012
    8 Post(s)
    0 Thread(s)
    1. You do the login (check user/pass, handle errors etc)
    + Set the cookie (I recomment session, if you don't specifically need a cookie) after the login is OK
    2. Redirect
    3. Make your check

    im woundering if i can retrieve a cookie from a login
    "From a login" means it's on the same server, right?
    Be nice to nerds. Chances are you'll end up working for one - Bill Gates
    > photos | admin panel

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts