User Name
Password
AppleNova Forums » Genius Bar »

PHP Problems (Permissions/MySQL)


Register Members List Calendar Search FAQ Posting Guidelines
PHP Problems (Permissions/MySQL)
Thread Tools
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2005-01-17, 09:55

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...
[php]$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());
}
[/php]
...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[php]include("include/dbconenct.php");[/php]

But for some reason, when I use the include(), I get this error...
Quote:
"Invalid query: Access denied for user: 'ast3r3x@localhost' (Using password: NO)"
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.

Any ideas on either of my painfully annoying problems?
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-01-17, 13:29

Obvious question, but have you got <?php and ?> tags in your include?
  quote
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2005-01-17, 14:11

Quote:
Originally Posted by Gargoyle
Obvious question, but have you got <?php and ?> tags in your include?
Yes I have got them.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2005-01-18, 09:47

That is a strange one!

The only thing I can suggest, again its pretty obvious, it to double and tripple check all your filenames and directories. I have lost count of the number of times I have saved a file with the wrong name, then saved it with the right name but then used the wrong name in my include line - then kicking the hell out of something because I stick this in my file...
[php]print("YOUR IN THIS F***K FILE!!");[/php]
and it doesnt show up! It then takes me 2 hours to realise I am including the wrong file!


OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
johnq
Multi-touch Piñata
 
Join Date: May 2004
 
2005-01-18, 10:00

Quote:
include("include/dbconenct.php");

Might want to change that to:

include("include/dbconnect.php");



Also, can you include anything else? Just do a test?
  quote
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2005-01-18, 10:47

I just typed that wrong when I was putting it in here. The REAL interesting...and odd thing is that if I make the code in my dbconnect.php a function, and then call the function in dbconnect.php it works. How lovely huh?

I always forget what directory I'm in and often get file paths wrong, but I'm pretty sure this is correct. I'll check again when I get home, but I have already I believe.

As for the priv. thing, I think I'm just not going to allow them to upload .php/.php3/.php4 files until someone can give me an answer to that.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Ear related problems... Neø AppleOutsider 10 2004-10-05 20:11
HELP! URGENT. DOWNGRADE PHP 5.0.1 to 4.3.6 hype.it Genius Bar 2 2004-08-31 19:15
Fantom Drive Problems spiff Genius Bar 2 2004-07-12 21:25


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 03:47.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova