I need help with php

Discussion in 'Programming' started by Papua, Jan 19, 2008.

  1. #1
    Hello ,I have problem with this code ...

    <?php

    if (isset($_GET['page']) && isset($_GET['action'])){
    $soubor = $_GET['page'];
    $action = $_GET['action'];

    $soubor2= dirname($_SERVER["SCRIPT_FILENAME"])."/".$soubor."/".$action.".php";
    if(file_exists($soubor2)){
    if(substr_count($soubor,$action,"../")>0){
    echo "Error";
    }elseif($soubor=="index" or $soubor=="/index" or $action=="index" or $action=="/index"){
    echo "Error";
    header("HTTP/1.0 404 Not Found");
    }else{

    include $soubor2;
    }
    }else{
    include "error404.php";
    }
    }else{
    include "uvod.php";
    }
    ?>

    But i dont know where is mistakes ....
    I want to the code , when I get this index.php?page=some&action=some

    Pls help me ,I am amateur in PHP , thank you ..
     
    Papua, Jan 19, 2008 IP
  2. Xeter_Design

    Xeter_Design Peon

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi there,

    Maybe you should explain exactly what you want the script to do and then maybe i can help, as i don't understand what you are trying to communicate in the post.

    Kind Regards,
    Nick
    CEO Xeter Design and Development
     
    Xeter_Design, Jan 22, 2008 IP
  3. Dr. XYZ

    Dr. XYZ Guest

    Messages:
    226
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Agree with you. It seem like an attempt to make a dynamic web page but not sure though.

    ·​
     
    Dr. XYZ, Jan 22, 2008 IP