Solved

include in upper directory

Posted on 2011-03-09
4
361 Views
Last Modified: 2012-05-11
the code below if    config.php    stay in the directory that is  upper than this  file stay how can i correct

include 'config.php';


<?php
include 'config.php';
include 'opendb.php';

$query  = "SELECT name, subject, message FROM contact";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo "Name :{$row['name']} <br>" .
         "Subject : {$row['subject']} <br>" .
         "Message : {$row['message']} <br><br>";
}

include 'closedb.php';
?>
0
Comment
Question by:teera
  • 3
4 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
Comment Utility
I'm not sure if this is what you mean, but
if(file_exists("../'config.php")){
   // do someting
}
0
 

Author Comment

by:teera
Comment Utility
hi Roads_Roads

what ../  itmean upper directory or root directory or all of upper directory
0
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 200 total points
Comment Utility
../
it means upper directory
./
means root
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
Comment Utility
What do you want to do, can you provide a natural language pseudocode ?
I mean
IF (THERE IS SOMETHING IN SOME DIR){
DO THIS
}
ELSE
{
DO THAT
}
0

Featured Post

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

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 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

17 Experts available now in Live!

Get 1:1 Help Now