se7enet purgatorio

Page 1 of 1 1
Topic Options
Rate This Topic
#4183 - 07/12/04 08:28 PM Admin.php
Dawg
Malt-o-Meal


Registered: 07/12/04
Posts: 3

Offline
So i have the game installed and working correctly, however, when i try to access the admin/admin.php i am getting an error:

No Database Selected

I double checked the config file and it is fine, I am unable to loccate in the admin.php file where it even looks for the database info.

Any help would be appreciated.

Top
#4184 - 07/12/04 08:53 PM Re: Admin.php
Dawg
Malt-o-Meal


Registered: 07/12/04
Posts: 3

Offline
Ok, after more searching:

The admin php includes ../lib.php

the code reads:


// Open database connection.

function opendb() {


include('config.php');
extract($dbsettings);
$link = mysql_connect($server, $user, $pass) or die(mysql_error());
mysql_select_db($name) or die(mysql_error());
return $link;

}



Which looks fine to me, but not being a php programmer, I dont know.

Is there something wrong with the call??

Top
#4185 - 07/12/04 11:18 PM Re: Admin.php
Jamin Administrator
Cookie Crisp
****

Registered: 02/25/05
Posts: 2649
Loc: Texas

Offline
It's always worked on every server I've tested. Could possibly be something weird with PHP's setting for include paths. In admin.php, where it says include('../admin.php'), try changing it to include('full/path/to/admin.php') and see if that fixes it.

If you don't know your full path, make a new file called env.php and just put <? phpinfo(); ?> in it, then run it and scroll down till you find DOCUMENT_ROOT in the Apache Environment section. That'll give you the path to your web root, then just finish it off with the folders you installed the game to.

Hope this helps. Lemme know if it still screws up after you do that, and I'll try to think of something else.

---Jamin

Top
#4186 - 07/13/04 09:09 AM Re: Admin.php
Maebius
Malt-o-Meal


Registered: 02/05/04
Posts: 18

Offline
I ran into that very problems when I changed hosts. The original host worked without a hitch, but moving it forced me to rewrite the includes with a full path.
Hope that help! Smiler

-Maebius

Top
#4187 - 07/13/04 03:27 PM Re: Admin.php
Dawg
Malt-o-Meal


Registered: 07/12/04
Posts: 3

Offline
Thanks. that was a help.

maybe i'll mention this for the future.

Windows 2000 with apache 2 php and mysql.

I had to edit the cookie.php file as well

// if (md5($row["password"] . "--" . $dbsettings["secretword"]) != $theuser[2]) { //die("Invalid cookie data (Error 3). Please clear cookies and log in again."); }

To allow access to the admin panel.

A simple htaccess file provides security for me ..

Top
#4188 - 07/13/04 09:15 PM Re: Admin.php
Jamin Administrator
Cookie Crisp
****

Registered: 02/25/05
Posts: 2649
Loc: Texas

Offline
I'm running that same setup on my localhost box (well, WinXP, but basically the same thing) and it's never given me any problems.

Glad you got it working though.

---Jamin

Top
Page 1 of 1 1


Hop to:

se7enet

Barack Obama Logo