January 23, 2019, 01:49:14 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
Author Topic: username/password array does not work if in my includes file  (Read 4214 times)
Posts: 12

« on: June 26, 2009, 06:10:22 AM »

I am using Password Protect to make users log in before they get to an upload page. I called the password_protect page login.php, so at the top of upload.php I have the line

<?php include("login.php"); ?>

As I do not want to store the username/password pairs in the script itself I saved the $LOGIN_INFORMATION array to a file I called login.txt, which is in a special includes folder outside the root of my site. To access the usernames/passwords, I include the login.txt at the top of login.php

<?php include("../../includes/login.txt"); ?>

So far so good, it all works beautifully. Now for the problem:

In the same folder as login.txt I have a file called includes.txt, which contains all the other includes needed for my site. I thought it should be possible to add the $LOGIN_INFORMATION array to the includes.txt file, and then at the top of login.php put

<?php include("../../includes/includes.txt"); ?>

It should be able to get the array from that, right? But it doesn't -- when I try to access upload.php I get the login page, but when I enter a valid password and username and click the Log In button, I get a blank page. Obviously it's not getting at the username/password array, but I don't know why. I've experimented by taking bits out of the includes.txt file until it did work, and it seems to go wrong when there is a function in the same file as the $LOGIN_INFORMATION array.

Is this a known effect? Is there a way around it so I can store the passwords and usernames in my general includes.txt file?

Pages: [1]
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC