using the require function

Problems with the Windows version of XAMPP, questions, comments, and anything related.

using the require function

Postby Ch3my » 11. July 2005 11:18

Code: Select all
<?php
     require($_server["document_root"]."/config/db_config.php");
     $connection = mysql_connect($bd_host, $db_user, $db_password) or die("error connecting");
     echo "connection made";
     ?>


Thats my code and i'm trying to use an external php file with the connection info to connect to mysql. the folder config exists within the htdocs folder but i get this error msg

Warning: main(/config/db_config.php) [function.main]: failed to open stream: No such file or directory in C:\apachefriends\xampp\htdocs\test2.php on line 2

Fatal error: main() [function.require]: Failed opening required '/config/db_config.php' (include_path='.;c:\apachefriends\xampp\php\pear\') in C:\apachefriends\xampp\htdocs\test2.php on line 2


plz help.is it my code or do i need to know something more about xampp.

:)
Ch3my
 
Posts: 3
Joined: 11. July 2005 11:10

Postby Wiedmann » 11. July 2005 11:46

$_server != $_SERVER
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Ch3my » 11. July 2005 12:02

well it tried it in capitals but still no difference
Ch3my
 
Posts: 3
Joined: 11. July 2005 11:10

Postby Wiedmann » 11. July 2005 12:10

New error message?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby alucard01 » 11. July 2005 16:34

how about making $_server['document_root'] all UPPERCASE?
alucard01
 
Posts: 122
Joined: 15. May 2005 13:51

Postby Ch3my » 12. July 2005 17:03

:D cheers yep that did it..bloody thing. thx alot m8 :)
Ch3my
 
Posts: 3
Joined: 11. July 2005 11:10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 137 guests