469,927 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

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\newland\

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

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\newland\ so it is also uploaded to the testing folder of
C:\remote\newland\

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_globals off
php_value session.save_path C:\home\user\siteroot\sess\users
php_value session.cookie_time 3600
php_value session.gc_maxlifetime 3600
php_value include_path .:C:\home\user\siteroot\sess
php_value auto_prepend C:\home\user\siteroot\sess\path_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
Jul 17 '05 #1
2 1580
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
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\newland\

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

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\newland\ so it is also uploaded to the testing folder of
C:\remote\newland\

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_globals off
php_value session.save_path C:\home\user\siteroot\sess\users
php_value session.cookie_time 3600
php_value session.gc_maxlifetime 3600
php_value include_path .:C:\home\user\siteroot\sess
php_value auto_prepend C:\home\user\siteroot\sess\path_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


Jul 17 '05 #2
On Mon, 26 Jul 2004 10:04:27 +0200, A strange species called Erwin
Moller <si******************************************@spam yourself.com>
wrote:
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)
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.
2) .htaccess file.
Such a file contains AuthName, AuthUserFile, AuthGroupFile.
What I read in the manual at php.net suggested the following for the
..htaccess file:

php_flag register_globals off
php_value session.save_path /home/user/siteroot/sess/users
php_value session.gc_maxlifetime 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.
Did you set that up correctly on the servermachine?
I don't have a clue what AuthName, etc are. I just want to get
sessions working without register_globals being on.
More to-the-point: Do the files named in .htaccess exists on that machine?
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?
And do the values in those file make sense?
Only copying the .htaccess file is not enough!
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.
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.


I am just following this book in the top right corner at
allectomedia.com "Dreamweaver 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_globals on as everyone has advised not to.

John
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by XP | last post: by
1 post views Thread by Wayne Smith | last post: by
reply views Thread by Ed Ploy | last post: by
9 posts views Thread by buran | last post: by
reply views Thread by Steve Commisso | last post: by
2 posts views Thread by Gary Coutts | last post: by
1 post views Thread by Jakob Lithner | last post: by
9 posts views Thread by Ben | last post: by
10 posts views Thread by DavidPr | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.