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
https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/
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
https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/#findComment-443585
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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