Solved

include in upper directory

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP installation issues 11 59
google map tracking website 5 22
PHP PDO   How do I correctly remove record using DELETE FROM? 1 19
PHP Syntax Error 4 25
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 …

815 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

13 Experts available now in Live!

Get 1:1 Help Now