AR
Please can someone code this right
<?php
$action = strip_tags(trim($_GET['action']));
function header()
{
echo '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd">
<html>';
}
function footer()
{
echo '
</body></html>';
}
// INDEX PAGE
if($action == "")
{
echo header();
echo '<p>...</p>';
echo footer();
exit();
}
if($action == "friends")
{
echo header();
echo '
Site Friends<hr/>
<div><a href="http://">link</a></div>
<div>> <a href="http://">link</a></div>';
echo footer();
exit();
}
?>
When in url write ie http://site.tld/index.php?action=blabla , it does not get Error 404 page, gets something blank... 🙁
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
AR
Thanks Something else, thats which is what I feared because the index page is there. Is this a security whole?
Subzero, thanks bro, I use somethong like body.php for other pages because it is with prohibition of anonymous browser, do not whant to forbidd it on index.
Is something like this solution for all variables and if someone can code it ? :
if ("non existent or unvalid variable")
{
header('HTTP/1.1 404 Not Found');
exit();
}
Or something like......?
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
AR
subzero wrote:
do you want to make a error page ??
like i type link.com?action=admin
it will show
ERROR PAGE NOT FOUND!!
or you want to block hiden browsers ?
Yes, just to send browser to classic Not Found page if the requested variable does not exists or is undefined, not to make it my self (thats not itneresting 🙂 ).
Does if(isset) function doing something good for this? 😀
Right now I get just blank page.
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
AR
Thats it bro, with }else{ function is something I need. Maybe better than standard error page.
Thanks! 🙂
And whats the difference with
$action = strip_tags(trim($_GET['action'])); and $_GET[action] ?
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***