tbraley Posted April 5, 2006 Share Posted April 5, 2006 First I got this zip file from:[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?Thanks, Terry Link to comment https://forums.phpfreaks.com/topic/6654-connect-to-mysql-problems/ Share on other sites More sharing options...
wildteen88 Posted April 5, 2006 Share Posted April 5, 2006 I think you may have missed a step. if you look in admin/config.php file you should of noticed this line:[code]$database_exists = 0; // Set to 1, before installing, if database exists[/code] if you change 0 to 1 and save the config.php file you should be able to install whatever you're installing. Link to comment https://forums.phpfreaks.com/topic/6654-connect-to-mysql-problems/#findComment-24188 Share on other sites More sharing options...
tbraley Posted April 5, 2006 Author Share Posted April 5, 2006 Thanks wildteen88,How I missed that I'll never know. But that did it.Terry Link to comment https://forums.phpfreaks.com/topic/6654-connect-to-mysql-problems/#findComment-24192 Share on other sites More sharing options...
tbraley Posted April 5, 2006 Author Share Posted April 5, 2006 Well I got that working. Now it tell me to add :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 <?phpIf 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.Any suggestion? Link to comment https://forums.phpfreaks.com/topic/6654-connect-to-mysql-problems/#findComment-24209 Share on other sites More sharing options...
wildteen88 Posted April 5, 2006 Share Posted April 5, 2006 Are the files that you're adding[code]<? include ("access_control.php"); ?>[/code]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:[code]<? include ("../access_control.php"); ?>[/code]NOTE you dont need to use that code in every file but only the pages you want password protected. Link to comment https://forums.phpfreaks.com/topic/6654-connect-to-mysql-problems/#findComment-24249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.