Jump to content

shanparker

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

shanparker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have this query semi finished. I have two tables. I need to query the first table for only entries where the "user" field is valid because it's a user in the "friends" table. I have that working. The third thing it needs to do is make sure that the user who is logged in is in friends table column. Confusing. The site I'm working on is a Myspace type site - so two entries go into the friends table when a friend link is created. An association each way for the friend. Friend 1 is friends with Friend 2, and a second one to show that Friend 2 is friends with Friend 1. The query I have written so far checks that they are friends - but it returns two results instead of one from the sticky_notes table because it's reading the two associations. The query so far is: [code]SELECT * FROM sticky_notes,friends WHERE friends.friend = sticky_notes.user LIMIT 5[/code] Now all I need to do is to get it to check for the third value. That the user (in the friends table) is the user who is logged in (which is the value $session->username). I assume I'm on the right path here.
  2. This is my first post here - when I'm trouble shooting Yahoo searches often bring up threads here - so I thought I would join and see if you guys could help me with this problem I'm having (don't worry I'll have plenty more in the future!) I'm still somewhat knew to PHP so I'm still getting the hang of even the simple stuff. I posted this at another forum as well, and will just repeat it here to see if anyone can help! --- I've been racking my brain with this and searching all over the internets and haven't been able to find a solution that I've been able to make work. I'm using the awesome login script for evolt.org. Works really well. However I've set up a subdomain with mod_writes on my site. So users have addresses - like [a href=\"http://my.website.com/user\" target=\"_blank\"]http://my.website.com/user[/a] The script is using cookies and sessions and I need the sessions to carry across the the subdomains. However they are not and I can't get them to work. I've read up on several ways to fix the problem but none have worked. So I thought perhaps if I provided the script pieces here that maybe someone could help me. In the constants.php file: [code]/** * Cookie Constants - these are the parameters * to the setcookie function call, change them * if necessary to fit your website. If you need * help, visit www.php.net for more info. * <http://www.php.net/manual/en/function.setcookie.php> */ define("COOKIE_EXPIRE", 60*60*24*100);  //100 days by default define("COOKIE_PATH", "/");  //Avaible in whole domain [/code] Then in the session.php file it sets the cookie here: [code]/**        * This is the cool part: the user has requested that we remember that        * he's logged in, so we set two cookies. One to hold his username,        * and one to hold his random value userid. It expires by the time        * specified in constants.php. Now, next time he comes to our site, we will        * log him in automatically, but only if he didn't log out before he left.        */       if($subremember){          setcookie("cookname", $this->username, time()+COOKIE_EXPIRE, COOKIE_PATH);          setcookie("cookid",   $this->userid,   time()+COOKIE_EXPIRE, COOKIE_PATH);       }       /* Login completed successfully */       return true;    } [/code] I tried changing the "/" to ".domain.com" like I saw suggested at several sites but I was still loosing my session at the subdomain. Any help on this matter is appreciated. I know there's a solution. SOMEWHERE!
×
×
  • 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.