vendredi 6 février 2015

Adding a '/' makes the website crash

This is how it looks without the '/' (localhost/index.php): http://ift.tt/16Lopl0


After adding it at the end of url (localhost/index.php/): http://ift.tt/16Lopl2


Anyone with experience that could just give a short tip about a probable reason of that.


thanks in advance.


Here is the index.php :




require_once("php/config.php");

if(substr_count($_SERVER['PHP_SELF'],'/')==1){ // fixing that bug


require_once( ROOT_PATH . "php/header.php" );

if(isvalid(quizzid()) == true){

switch(quizzid()){

case 0:

require_once( ROOT_PATH . "php/questionarios.php" );

break;

default:

require_once( ROOT_PATH . "php/questionario.php" );

break;

}
}

require_once(ROOT_PATH . "php/footer.php"); // footer

}else{ // if there are more than 1 '/' it would redirect to > index

header('Location: /index.php');


}






Aucun commentaire:

Enregistrer un commentaire