28, May 2012

Login page link is incorrect - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Login page link is incorrect
« previous next »
Pages: [1] Print

Author Topic: Login page link is incorrect  (Read 2452 times)
I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« on: Aug 25, 2006, 10:36:09 pm »

Hello:

I have the scripts set up ok, database queries done, etc. I registered as the 'admin', did the email validation link, and arrived back at the login page, typed in the user/password I established at the initial registration (as admin) and when I click submit I get to this page:

http://login.php/

Obviously there's something missing and I can't spot anything in the db_config.php that points to this and the login form 'action' points to PHP_SELF.

So, where is this setting that I need to tweak in order for the login form to point to the right location? Thanks in advance!
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Aug 25, 2006, 10:39:31 pm »

Hello:

I have the scripts set up ok, database queries done, etc. I registered as the 'admin', did the email validation link, and arrived back at the login page, typed in the user/password I established at the initial registration (as admin) and when I click submit I get to this page:

http://login.php/

Obviously there's something missing and I can't spot anything in the db_config.php that points to this and the login form 'action' points to PHP_SELF.

So, where is this setting that I need to tweak in order for the login form to point to the right location? Thanks in advance!

what about this setting?
define("START_PAGE", "/classes/access_user/example.php");

I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #2 on: Aug 25, 2006, 10:48:18 pm »

That remains untouched as per the default setting. Here's the code snippet:

Code:
// variables (locations) standard pages (combine the pathes from the top or use your own)
define("LOGIN_PAGE", CLASS_PATH."login.php");
define("START_PAGE", "/classes/access_user/example.php");
define("ACTIVE_PASS_PAGE", APPLICATION_PATH."activate_password.php");
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");
define("ADMIN_PAGE", APPLICATION_PATH."admin_user.php");
// your path must be related to the site root.

The main paths area is as so:

Code:
// use this pathes and/or define the pathes for the "standard" pages
define("CLASS_PATH", dirname($_SERVER['PHP_SELF'])."/"); // the location where the class is executed
$sec_path = "/classes/access_user/"; // a second location where the scripts should be
define("APPLICATION_PATH", $sec_path);

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Aug 25, 2006, 10:53:45 pm »

you're example "http://login.php" doesn't match the settings, start with the class like provided inside the manual until you learned how you have to work with pathes in PHP. (if you can handle a class you're able to include files)

I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #4 on: Aug 25, 2006, 11:06:07 pm »

That's what I can't figure out. The URL that the login page goes to is opposite of what the settings are. It should go to http://www.mydomain.com/login.php

It's omitting the domain name and adding a '/' on the end like it's looking for a folder.
I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #5 on: Aug 26, 2006, 01:08:37 am »

Olaf, could you clarify what you're talking about, please. The db_config.php file is the default settings except for the database parameters.

I've set the files up in the public_html folder with the exception of the class files which are in

/classes
     /classes/access_user/
     /classes/upload/

I'm assuming that this line:
Code:
define("CLASS_PATH", dirname($_SERVER['PHP_SELF'])."/"); // the location where the class is executed

Is the line controlling where the pages point to. I can't find any other settings regarding path variables. Please clarify. Thanks.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Aug 26, 2006, 08:27:32 am »

If you use this directory structure it must work, maybe you can upload the application somewhere?


EDIT: wait, are there two folders named "classes"?

I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #7 on: Aug 26, 2006, 08:48:29 am »

It's already uploaded for testing. Here's the link: http://www.plateauprofessionals.com/register.php
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Aug 26, 2006, 10:18:08 am »

I will check this later (this afternoon)

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Aug 26, 2006, 05:06:22 pm »

what is the include path of your register file?

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Aug 26, 2006, 05:08:49 pm »

and check the login form:

<form name="form1" method="post" action="//login.php"> (note the double slash)  Angry

I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #11 on: Aug 26, 2006, 05:46:30 pm »

Here's the include statement at the top of the 'register.php' file:

Code:
include($_SERVER['DOCUMENT_ROOT']."/classes/access_user/access_user_class.php");

In regards to the login form and the double slashes, what you have there is what is shown when you View Source via your browser. The code looks like this:

Code:
<h2>Login:</h2>
<p>Please enter your login and password.</p>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  <label for="login">Login:</label>
  <input type="text" name="login" size="20" value="<?php echo (isset($_POST['login'])) ? $_POST['login'] : $my_access->user?>"><br>
  <label for="password">Password:</label>
  <input type="password" name="password" size="8" value="<?php echo (isset($_POST['password'])) ? $_POST['password'] : $my_access->user_pw?>"><br>
  <label for="remember">Remember login?</label>
  <input type="checkbox" name="remember" value="yes"<?php echo ($my_access->is_cookie == true) ? " checked" ""?>>
  <br>
  <input type="submit" name="Submit" value="Login">
</form>

That's what i'm trying to figure out is why it's generating a link to '//login.php'
Bill Cosby is my Father
*
Gender: Male
Posts: 4
28 credits
Members referred : 0


caravan in the desert (sahara)


« Reply #12 on: Aug 26, 2006, 05:47:59 pm »

Hello Olaf
I am Taoumi from Tangier.What's going wrong with Adsence and banners ?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #13 on: Aug 27, 2006, 10:12:16 am »

Hello Olaf
I am Taoumi from Tangier.What's going wrong with Adsence and banners ?
this forum is about the access user class start a new thread...

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Aug 27, 2006, 10:14:50 am »

Quote
That's what i'm trying to figure out is why it's generating a link to '//login.php'

Then there is maybe something wrong with your server configuration

I love Pokemon
*
Posts: 13
86 credits
Members referred : 0


« Reply #15 on: Aug 27, 2006, 08:14:36 pm »

I don't think so. All the other links work fine. It's after I register, confirm, and then try to log in. That's when the error occurs.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #16 on: Aug 27, 2006, 10:45:23 pm »

I don't think so. All the other links work fine. It's after I register, confirm, and then try to log in. That's when the error occurs.
just check the value of the action attribute from you form, its not right to have there "//login.php" if you use the server var php_self, fix this first...

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3819
Tags : forums domains databases Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Login page link is incorrect
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 03:25:44 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.