PHP Permissions / MySQL Error
Posted: Mon Jan 17, 2005 1:15 pm
I'm building a website for my friends so they will stop using xanga.com, but besides running into several problems I can't say I have the slightest how to resolve.
First, since I'm going to have many user accounts with their own directory, how do I stop a script running in swigg.net/ast3r3x/ from messing anything up in swigg.net/ or any other directory that isn't inside of swigg.net/ast3r3x?
My second MySQL question is when I try to connect to my database it works, but when I try to query I get problems when I try to include() my database connect information. Normally I have this in my scripts...
...and that works. But since I don't want to be repetitious, I normally like to take code like that and put it into a file, and then
But for some reason, when I use the include(), I get this error...
Any ideas on either of my painfully annoying problems?
First, since I'm going to have many user accounts with their own directory, how do I stop a script running in swigg.net/ast3r3x/ from messing anything up in swigg.net/ or any other directory that isn't inside of swigg.net/ast3r3x?
My second MySQL question is when I try to connect to my database it works, but when I try to query I get problems when I try to include() my database connect information. Normally I have this in my scripts...
Code: Select all
$link = mysql_connect('localhost', 'ast3r3x', 'pass');
if(!$link)
{
die('Not connected : ' . mysql_error());
}
$db = mysql_select_db('swigg', $link);
if(!$db)
{
die ('Can''t use foo : ' . mysql_error());
}Code: Select all
include("include/dbconenct.php");I guess the main problem is that I am not using a password, but I have a password in there, so I don't know why it says that."Invalid query: Access denied for user: 'ast3r3x@localhost' (Using password: NO)"
Any ideas on either of my painfully annoying problems?