Ok, I have been developing my CMS for quite sometime. Its about 85% complete, and getting closer. The only thing now I recently noticed is something very strange.
Open a browser, don't point it anywhere yet. Go to http://timtimtimma.com/index.php?find=Members&file=Login
that link should redirect you to a url that is: http://timtimtimma.com/index.php?find=News
That is NOT suppose to happen. And I can not figure out WHY its doing it, after the initial visit you can type any url, and it will go directly to that page, but until you visit it atleast once, it will always redirect back to the main page, I noticed this when I was trying to show a friend a article that was posted, and h said it redirected him back to the main page. I tried several other links, and they all do the same thing, until you visit the site atleast once, then everything works as its supose to. Wtf is it doing this for?!
Here is the content code...
<?php
if(!defined("IN_DB")){
die("Hacking Attempt!");
}
ob_start();
if(stristr($_GET['find'], "http:////") || stristr($_GET['find'], "https:////") || stristr($_GET['find'], "ftp:////") || stristr($_GET['find'], "http://") || stristr($_GET['find'], "https://") || stristr($_GET['find'], "ftp://")) {
include($Current_Directory."/Modules/News/index.php");
}
if(empty($_GET['file']) && isset($_GET['find'])){
$GrabDir = $Current_Directory .'/Modules/'.$_GET['find'].'/index.php';
}elseif(isset($_GET['file']) && isset($_GET['find'])){
$GrabDir = $Current_Directory .'/Modules/'.$_GET['find'].'/'.$_GET['file'].'.php';
}
if (empty($_GET['find'])){
include_once($Current_Directory."/Modules/News/language/".$user->language().".php");
include($Current_Directory.'/Modules/News/index.php'); //this is the file that redirects you to index.php?find=News
} elseif (file_exists($GrabDir)) {
include_once($Current_Directory."/Modules/".$_GET['find']."/language/".$user->language().".php");
include($GrabDir);
} else {
$Directory = $Current_Directory.'/Modules/'.$_GET['find'].'/index.php';
if(isset($_GET['file']) && !file_exists($Directory) || empty($_GET['file']) && !file_exists($Directory)){
$Table->Open();
echo "The Module \"".htmlspecialchars(addslashes(trim($_GET['find'])))."\" does not exist!\n\n";
$Table->Close();
}elseif(isset($_GET['file']) && file_exists($Directory)){
$Table->Open();
echo "The File \"".htmlspecialchars(addslashes(trim($_GET['file'])))."\" in Module \"".htmlspecialchars(addslashes(trim($_GET['find'])))."\" does not exist!\n\n";
$Table->Close();
}
}
$PageContent = ob_get_contents();
ob_end_clean();
?>
I checked the code out, and it has to be going to the if/else statement that checks if $_GET['find'] is empty. But the thing is when u go to index.php?find=Members&file=Login find is OBVIOUSLY set. So whats going on here???? I don't understand why its doing this..ive tried 2 other servers and they do the exact same thing. Any ideas as to what its ding and how it can be resolved?