Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-01-04
6
Medium Priority
?
317 Views
Last Modified: 2013-01-05
Can't get script to connect to database connect script in root. It's 2 levels up. Getting HTTP 500 response
register.php
0
Comment
Question by:QUESTOMNI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38743998
shouldn't the path be: ('../mysqli_connect.php') instead of ('.../mysqli_connect.php')

Cd&
0
 
LVL 11

Accepted Solution

by:
Chris Sandrini earned 2000 total points
ID: 38745069
two levels up is ../../

so

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

Open in new window

0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38745456
If it's in the 'root', you should be able to use...

require ('/mysqli_connect.php');

Open in new window

0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38745924
Hmmm, that about covers the possibilities; other than hard coding an absolute path.

Cd&
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38746618
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
 

Author Closing Comment

by:QUESTOMNI
ID: 38746771
Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The viewer will learn how to dynamically set the form action using jQuery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question