Solved

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

Posted on 2013-01-04
6
306 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
6 Comments
 
LVL 53

Expert Comment

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

Cd&
0
 
LVL 11

Accepted Solution

by:
un1x86 earned 500 total points
Comment Utility
two levels up is ../../

so

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

Open in new window

0
 
LVL 82

Expert Comment

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

require ('/mysqli_connect.php');

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 53

Expert Comment

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

Cd&
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
Thanks.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now