Can't get script to connect to database connect script in root.

Can't get script to connect to database connect script in root. It's 2 levels up. Getting HTTP 500 response
register.php
QUESTOMNIAsked:
Who is Participating?
 
Chris SandriniConnect With a Mentor Senior System EngineerCommented:
two levels up is ../../

so

require ('../../mysqli_connect.php');

Open in new window

0
 
COBOLdinosaurCommented:
shouldn't the path be: ('../mysqli_connect.php') instead of ('.../mysqli_connect.php')

Cd&
0
 
Dave BaldwinFixer of ProblemsCommented:
If it's in the 'root', you should be able to use...

require ('/mysqli_connect.php');

Open in new window

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
COBOLdinosaurCommented:
Hmmm, that about covers the possibilities; other than hard coding an absolute path.

Cd&
0
 
Ray PaseurCommented:
After you get connected to the data base, you might want to learn about this:
http://php.net/manual/en/mysqli.real-escape-string.php
0
 
QUESTOMNIAuthor Commented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.