papua Posted January 19, 2008 Share Posted January 19, 2008 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 More sharing options...
revraz Posted January 19, 2008 Share Posted January 19, 2008 It would be helpful if you actually state what the problem is. http://www.phpfreaks.com/forums/index.php/topic,6264.0.html Link to comment https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/#findComment-443491 Share on other sites More sharing options...
naveenbj Posted January 19, 2008 Share Posted January 19, 2008 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 More sharing options...
$username Posted January 19, 2008 Share Posted January 19, 2008 If you could post the error you are getting too. B Link to comment https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/#findComment-443599 Share on other sites More sharing options...
revraz Posted January 19, 2008 Share Posted January 19, 2008 Good idea! If you could post the error you are getting too. B Link to comment https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/#findComment-443601 Share on other sites More sharing options...
pkSML Posted January 20, 2008 Share Posted January 20, 2008 Also, please place your PHP code within code tags. Just remove the spaces from what you see below. [ code][ /code] OR you could post your code at The Code-Bin ( http://code-bin.homedns.org ), which is a site I run for such a purpose Link to comment https://forums.phpfreaks.com/topic/86775-i-need-help-with-php/#findComment-443967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.