Jump to content

I need help with php


papua

Recommended Posts

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 ..

 

 

Link to comment
Share on other sites

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 ..

 

 

 

Hello,

 

Try this

if (isset($_GET['page'] && ($_GET['action'))

----------------

Im not sure but i hope it could help!!

 

Regards,

Nj

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.