Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

include in upper directory

Posted on 2011-03-09
4
Medium Priority
?
409 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
[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
  • 3
4 Comments
 
LVL 27

Expert Comment

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

Author Comment

by:teera
ID: 35080595
hi Roads_Roads

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

Accepted Solution

by:
Lukasz Chmielewski earned 800 total points
ID: 35080618
../
it means upper directory
./
means root
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35080629
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

660 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