25 chars of wasted space.
|
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:
Any ideas on either of my painfully annoying problems? |
|
quote |
http://ga.rgoyle.com
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
|
Obvious question, but have you got <?php and ?> tags in your include?
|
quote |
25 chars of wasted space.
|
Quote:
|
|
quote |
http://ga.rgoyle.com
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
|
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 |
Multi-touch Piñata
Join Date: May 2004
|
Quote:
Might want to change that to: include("include/dbconnect.php"); ![]() Also, can you include anything else? Just do a test? |
|
quote |
25 chars of wasted space.
|
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 |
|
Thread Tools | |
![]() |
||||
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 |