Connect to MySQL Problems
Posted 05 April 2006 - 01:24 PM
[a href=\"http://www.oscommerce.com/community/contributions,3062/category,5/search,password_protection.zip\" target=\"_blank\"]http://www.oscommerce.com/community/contri..._protection.zip[/a]
The readme file tells me to edit the config.php files to match my database. So I created a database in MySql and added the correct lines in the Config.phhp files. I uploaded the folder to my server and went to the intall file and I get an error telling me:
"Can't create database 'password'. Database exists"
Well, Yea. Thats what I thought I was I need to do.
What is the problem? Any Ideas?
Posted 05 April 2006 - 02:12 PM
$database_exists = 0; // Set to 1, before installing, if database existsif you change 0 to 1 and save the config.php file you should be able to install whatever you're installing.
Posted 05 April 2006 - 02:23 PM
How I missed that I'll never know. But that did it.
Posted 05 April 2006 - 03:36 PM
To password protect any file, add this line of code to the top of the very top of the file:
<? include ("access_control.php"); ?>
On the page I wnt to protect I added this line. I tried adding it before the <?php and after the <?php
If you add it after the <?php all I get is an error page telling me theres an error on line (2) <the code.
Do the files I want to protect have to be in the same folded as the password protect folder or can the be in seperate folder. Here what I have:
A folder thats called password_protect. < admin area and all. Works fine.
A folder called photoalbum. In side this folder is picture.php that I want to protect. I added the code from above but it didn't seem to work. So I moved the "photoalbum folder" into the "password_protect folder" but that didn't seem to help.
Posted 05 April 2006 - 06:08 PM
<? include ("access_control.php"); ?>to in the same folder as access_control.php?
If they then that code is file, but if you add that code to a file that is not in the same folder as access_control.php you will need to do this instead:
<? include ("../access_control.php"); ?>
NOTE you dont need to use that code in every file but only the pages you want password protected.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users