Hello All,
I'm new to the world of php. I've just had a site designed for me by a company, and I'm now trying to manage and grow it, so it will suit my needs.
The site was built in a folder called mysite.com/test. I coppied this folder a number of times, so I now have mysite.com/test2, mysite.com/test3 etc. Each folder acts as its own landing page.
they setup an interface where we can control the upsells presented to the customer; basically a template. To access, I go to mysite.com/test/admin.php to login. I'd like to be able to be able to have a separate login for each landing page, so I'm trying to setup access at mysite.com/test2/login.php.
I've copied my database, so that there are 2. I've pointed my dbconnect.php to the new database I created.
Originally, the code looked like this;
In my test2 folder, I changed the code to this;
energym2_wp02 being the new database I created.
When I try to login, I get the following error;
Below is the relevant (I think) code from the login page in /test2
Any thoughts, ideas, suggestions would be greatly appreciated.
Please let me know if there is any additional info required to answer this question.
Andrew
I'm new to the world of php. I've just had a site designed for me by a company, and I'm now trying to manage and grow it, so it will suit my needs.
The site was built in a folder called mysite.com/test. I coppied this folder a number of times, so I now have mysite.com/test2, mysite.com/test3 etc. Each folder acts as its own landing page.
they setup an interface where we can control the upsells presented to the customer; basically a template. To access, I go to mysite.com/test/admin.php to login. I'd like to be able to be able to have a separate login for each landing page, so I'm trying to setup access at mysite.com/test2/login.php.
I've copied my database, so that there are 2. I've pointed my dbconnect.php to the new database I created.
Originally, the code looked like this;
Code:
<?php mysql_connect("localhost", "energym2_wp01", "***"); mysql_select_db("energym2_wp01"); ?>
Code:
<?php mysql_connect("localhost", "energym2_wp01", "***"); mysql_select_db("energym2_wp02"); ?>
When I try to login, I get the following error;
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource in /home/energym2/public_html/test3/login.php on line 15
Code:
if($_POST["btnLogin"] == "Login") { $sqlAuthentication = "SELECT id FROM tbl_admin_info WHERE UserID ='".$_POST["txtUserID"]."' AND Password ='".$_POST["txtPassword"]."'"; $resAuthentication = mysql_query($sqlAuthentication); $arrAuthentication = mysql_fetch_array($resAuthentication); $UsersID = $arrAuthentication['id']; $Role = "Admin"; if($UsersID > 0) { $_SESSION['id'] = $UsersID; $_SESSION['Role'] = $Role; header("location:productAdmin.php"); } else { $error = "<font style='color:#FF0000; width:170px;'>Invalid Login. Please Try Again!!!</font>"; } } mysql_close();
Any thoughts, ideas, suggestions would be greatly appreciated.
Please let me know if there is any additional info required to answer this question.
Andrew
Comment