Jump to content
Larry Ullman's Book Forums

Recommended Posts

Would you please explain how I would get to the sqli_connect file on my pc 

 

define ('MYSQL', '/path/to/mysqli_ connect.php');
 
the file is saved in Computer->Localdisk(C:)->EasyPHP->www
 
to make it work I have copied the file into my includes and it works fine but I know that it is a security risk.
 
thank YOU!
 
Link to comment
Share on other sites

Assuming you're using Windows:

 

define('MYSQL', 'C:\EasyPHP\www\\');

 

However, you might want to instead define a base URI constant for your web server, and then create all paths outside the web root relative to that base URI. For example (and I don't know if this is actually accurate or appropriate):

 

define('BASE_URI', 'C:\EasyPHP\\');
 
define('MYSQL', BASE_URI . 'www\\');

 

Hope that helps.

 

Edit: Note that the two backslashes at the end of the paths are necessary so that you don't escape the string-ending quote.

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...