Solved

include in upper directory

Posted on 2011-03-09
4
400 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 200 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

623 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