Re: Weird problem (groupcheck)



Hello,

I found what's wrong, but now I need a sollution.
In the directory 'root\login' is also where the cookie is created. The
cookie is only active for this directory. But I want the cookie to be active
for the complete website, from root to the lowest directory. But when I put
a webaddress in the setcookie function it doesn't set a cookie

For explample (form php.net)
setcookie ("TestCookie", "test",time()+3600, "/~rasmus/", ".utoronto.ca",
1);


"Bertman" <Bertman@xxxxxxxxxxxxxxxxxx> schreef in bericht
news:f6Gdnar3xYMcIhLfRVnyvQ@xxxxxxxxxxxxx
> Hello,
>
>
>
> I want to check an array, that's not the biggest problem. But now I'm
> having a real weird situation. I have a file 'checklogin.php' this file
> put all the groups where a user is member off in a array ($usergroups). I
> have a simple file to test it 'test.php'. When I put 'test.php' in the
> 'root\login' directory he will say exactly that I'm member off 2 groups
> (after I logged in). But when I put 'test.php' in the 'root', he will say
> that i'm member off 1 group. And when I put 'checklogin.php' in the root,
> he also will say that i'm member off one group. It's pretty weird, because
> the files don't have a path to other files except to 'incl\connect.php'
> (this file will make a connection to my MySQL database)
>
>
>
> Example below:
>
> root\login\test1.php
>
> - this one will say that i'm member off 2 groups
>
> root\test.php
>
> - this one will say that i'm member off 1 group
>
>
>
> (root = top of the server)
>
> root\login\checklogin.php
>
> root\login\test1.php
>
> root\test.php
>
>
> # test.php
> <?PHP
> include 'include\connect.php';
> include 'login\checklogin.php';
> echo count($usergroups);
> ?>
>
> # test1.php
> <?PHP
> include '..\include\connect.php';
> include 'checklogin.php';
> echo count($usergroups);
> ?>
>
> # checklogin.php
> <?php
> if (isset($_COOKIE["UserID"])) {
> if (isset($_COOKIE["Name"])) {
> if (isset($_COOKIE["Pass"])) {
> $userid = $_COOKIE["UserID"];
> $name = $_COOKIE["Name"];
> $pass = $_COOKIE["Pass"];
> $query = mysql_query("SELECT * FROM cd_user WHERE User_loginname='$name'
> AND User_password='$pass' AND User_id='$userid'") or die (mysql_error());
> if (mysql_num_rows($query)=='0') {
> $usergroup='0'; // 0 zijn public groepen
> $usergroups='0';
> $name='';
> } else { # mysql_num_rows($query)=='0'
> $usergroups='';
> $count='0';
> while($result = mysql_fetch_array($query)){
> $userid = $result["User_id"];
> $query1 = mysql_query("SELECT * FROM cd_user_and_group WHERE
> User_id='$userid'") or die (mysql_error());
> while($result1 = mysql_fetch_array($query1)){
> $usergroups[$count] = $result1["Group_id"]; //Maak een array aan met
> alle group nummers
> $count = $count + 1;
> }
> }
> } # mysql_num_rows($query)=='0'
> }else{
> //Pass not set.
> $usergroup='0'; // 0 zijn public groepen
> $usergroups='0';
> $name='';
> }
> }else{
> //name not set.
> $usergroup='0'; // 0 zijn public groepen
> $usergroups='0';
> $name='';
> }
> }else{
> //userid not set.
> $usergroup='0'; // 0 zijn public groepen
> $usergroups='0';
> $name='';
> }
> ?>
>


.



Relevant Pages

  • cookie problem
    ... The logic is something like this - for an alphabetic search, ... page is redirected back to the front end display page and a cookie is set on ... same front end page and sets the cookie and we can browse the member info. ...
    (microsoft.public.inetserver.asp.general)
  • Re: cookie problem
    ... Are you sure that the left frame is being refreshed? ... > page is redirected back to the front end display page and a cookie is set ... > same front end page and sets the cookie and we can browse the member info. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Weird problem (groupcheck)
    ... > cookie is only active for this directory. ... > active for the complete website, from root to the lowest directory. ... >> put all the groups where a user is member off in a array. ... >> echo count; ...
    (php.general)
  • Re: A PE resource directory -- difficulty in understanding it ...
    ... nowhere there is mentioned that those four levels (root, ... name/ID, language-split, data) are the required and/or the only ones. ... it allowed for the root to directly point to the data (a leaf node)? ... in the info I found the "OffsetToData" member of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Edgar Allen Poe, ROOT BOY and AS3
    ... graduating in 1967. ... He was a member of the Delta Kappa Epsilon fraternity. ... Root was a year older than Bush. ... While at Yale, he formed a band named Prince La La and the Midnight ...
    (alt.support.stop-smoking)