Login problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Login problems

    Hello

    I have created login pages but am having problems when I test them for
    my site.

    When I type all the registration info in it accepts it no problem.
    When I try and sign in though and then try and access the restricted
    pages it takes me back to the login page.

    The local root folder for the site is:
    C:\dw_dynapps\n ewland\

    The remote folder and testing server for the site is:
    C:\remote\newla nd\

    The URL is:



    I am wondering whether it is something wrong with my .htaccess file?
    And whether it is in the right location?

    I get a tad confused testing locally because I never know where to put
    things and what the site root is?

    I have put the .htaccess file in the same folder as
    C:\dw_dynapps\n ewland\ so it is also uploaded to the testing folder of
    C:\remote\newla nd\

    Is this the right place? If my site is upload to the remote folder
    would that then mean that the site root with just be the C drive, and
    that's where it should be located?

    In case it is already in the right place, and it might be something
    wrong in the actual file, this is what I have inside the file:

    php_flag register_global s off
    php_value session.save_pa th C:\home\user\si teroot\sess\use rs
    php_value session.cookie_ time 3600
    php_value session.gc_maxl ifetime 3600
    php_value include_path .:C:\home\user\ siteroot\sess
    php_value auto_prepend C:\home\user\si teroot\sess\pat h_file.php

    Again, I'm not sure if I have the paths correct because I'm not sure
    when testing locally.

    Cheers for any help

    John




    Win XP Pro / DW 7.0.1
    Running locally: Apache 2.0.49 / PHP 4.3.7 / MySQL 4.0.20a
  • Erwin Moller

    #2
    Re: Login problems

    Hi John,

    3 remarks that hopefully can help you:

    1) Study the difference between a directory on your harddisk and a directory
    served by a webserver.
    It is very strange that you tell us where which actual directory you use.
    The webserver is responsible to serve a certain directory (and its
    subdirectories) but can serve them to the client under a completely
    different name. That is not uncommon.

    If you say your URL to your remote server is http://localhost/newland I
    expect you are making a mistake. Unless configured very strangely,
    localhost always point the machine you type localhost in. (127.0.0.1)

    2) .htaccess file.
    Such a file contains AuthName, AuthUserFile, AuthGroupFile.
    Did you set that up correctly on the servermachine?
    More to-the-point: Do the files named in .htaccess exists on that machine?
    And do the values in those file make sense?
    Only copying the .htaccess file is not enough!

    3) This is just a hint: It you accidentely put wrong hyperlinks (like
    http://localhost/etc) into your app, or wrong form-action values, you may
    go from your remote server to your local server, maybe without noticing it.
    In that case your cookies will be invalid because your browser considers
    them to be different domains. (luckily)

    Hope that help.

    Good luck.
    Regards,
    Erwin Moller
    [color=blue]
    > Hello
    >
    > I have created login pages but am having problems when I test them for
    > my site.
    >
    > When I type all the registration info in it accepts it no problem.
    > When I try and sign in though and then try and access the restricted
    > pages it takes me back to the login page.
    >
    > The local root folder for the site is:
    > C:\dw_dynapps\n ewland\
    >
    > The remote folder and testing server for the site is:
    > C:\remote\newla nd\
    >
    > The URL is:
    > http://localhost/newland/
    >
    >
    > I am wondering whether it is something wrong with my .htaccess file?
    > And whether it is in the right location?
    >
    > I get a tad confused testing locally because I never know where to put
    > things and what the site root is?
    >
    > I have put the .htaccess file in the same folder as
    > C:\dw_dynapps\n ewland\ so it is also uploaded to the testing folder of
    > C:\remote\newla nd\
    >
    > Is this the right place? If my site is upload to the remote folder
    > would that then mean that the site root with just be the C drive, and
    > that's where it should be located?
    >
    > In case it is already in the right place, and it might be something
    > wrong in the actual file, this is what I have inside the file:
    >
    > php_flag register_global s off
    > php_value session.save_pa th C:\home\user\si teroot\sess\use rs
    > php_value session.cookie_ time 3600
    > php_value session.gc_maxl ifetime 3600
    > php_value include_path .:C:\home\user\ siteroot\sess
    > php_value auto_prepend C:\home\user\si teroot\sess\pat h_file.php
    >
    > Again, I'm not sure if I have the paths correct because I'm not sure
    > when testing locally.
    >
    > Cheers for any help
    >
    > John
    >
    >
    >
    >
    > Win XP Pro / DW 7.0.1
    > Running locally: Apache 2.0.49 / PHP 4.3.7 / MySQL 4.0.20a[/color]

    Comment

    • John

      #3
      Re: Login problems

      On Mon, 26 Jul 2004 10:04:27 +0200, A strange species called Erwin
      Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om>
      wrote:
      [color=blue]
      >Hi John,
      >
      >3 remarks that hopefully can help you:
      >
      >1) Study the difference between a directory on your harddisk and a directory
      >served by a webserver.[/color]
      [color=blue]
      >It is very strange that you tell us where which actual directory you use.
      >The webserver is responsible to serve a certain directory (and its
      >subdirectories ) but can serve them to the client under a completely
      >different name. That is not uncommon.
      >
      >If you say your URL to your remote server is http://localhost/newland I
      >expect you are making a mistake. Unless configured very strangely,
      >localhost always point the machine you type localhost in. (127.0.0.1)[/color]

      I am just working through my book on Dreamweaver and PHP by Jeffrey
      Bardzell, and this is the URL that was specified to use as localhost
      is where Apache serves the pages to from it's root folder.
      [color=blue]
      >2) .htaccess file.
      >Such a file contains AuthName, AuthUserFile, AuthGroupFile.[/color]

      What I read in the manual at php.net suggested the following for the
      ..htaccess file:

      php_flag register_global s off
      php_value session.save_pa th /home/user/siteroot/sess/users
      php_value session.gc_maxl ifetime xxx
      php_value include_path .:/home/user/siteroot.com/sess
      php_value auto_prepend /home/user/siteroot.com/sess/path_file.php

      It didn't say any of the things you mentioned above.
      [color=blue]
      >Did you set that up correctly on the servermachine?[/color]

      I don't have a clue what AuthName, etc are. I just want to get
      sessions working without register_global s being on.
      [color=blue]
      >More to-the-point: Do the files named in .htaccess exists on that machine?[/color]

      I dont know. Like I said I don't understand the paths, I am just a
      newbie, and no one has said that I would need to create any additional
      files. I've just been told to use a .htaccess file. If this is going
      to cause so much problems I'm not sure if it is really worth it. Is
      there an easier way to get sessions to work without globals being
      switched on?
      [color=blue]
      >And do the values in those file make sense?
      >Only copying the .htaccess file is not enough![/color]

      Okay. I think this .htaccess file is more trouble than its worth. In
      previous replies to my posts in this group nobody said I would need to
      create anything other than a .htaccess file. I didn't know I would
      need to create lots of additional files in different locations. I was
      told a .htaccess file in the folder above where I keep the webfiles
      will sort everything out for sessions.
      [color=blue]
      >3) This is just a hint: It you accidentely put wrong hyperlinks (like
      >http://localhost/etc) into your app, or wrong form-action values, you may
      >go from your remote server to your local server, maybe without noticing it.[/color]

      I am just following this book in the top right corner at
      allectomedia.co m "Dreamweave r MX 2004 with ASP, ColdFusion, and PHP:
      Training From the Source" By Jeffrey Bardzell

      This is the correct URL for the site, running locally with apache, php
      and mysql on Windows XP.

      All I want to do is to get sessions to work locally without turning
      register_global s on as everyone has advised not to.

      John


      Comment

      Working...