Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    716
    Thanks
    8
    Thanked 17 Times in 16 Posts

    check if folder exists

    I have this script

    PHP Code:
    <?php    
    $dirname 
    $_POST["install"];    
    $filename "{$dirname}/";    
    if (
    file_exists($filename)) {
    ?>

    PLEASE DELETE THE INSTALL DIRECTORY!

    <?php  

    else 
    {    
    ?>
    OTHER MESSAGE IF THERE IS NO INSTALL DIRECTORY
    <?php 
     
    }    
    ?>
    It seems to not work, When I do have the install folder it says:
    PLEASE DELETE THE INSTALL DIRECTORY!

    and when I delete it, the message stays the same, does anyone know the problem?

  • #2
    Regular Coder
    Join Date
    Sep 2008
    Posts
    716
    Thanks
    8
    Thanked 17 Times in 16 Posts
    Sorry guys, I fixed it.

    PHP Code:
    <?php    
    $filename 
    "install/";    
    if (
    file_exists($filename)) {

    echo 
    "PLEASE DELETE THE INSTALL DIRECTORY!";


    else 
    {    
    ?>
    OTHER MESSAGE IF THERE IS NO INSTALL DIRECTORY
    <?php 
     
    }    
    ?>
    I removed the $_POST thing and just hardcoded it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •