Page 1 of 1

simple variable passing question

Posted: Mon Mar 10, 2003 2:06 pm
by papasmurf
ok, i have a basic template thingy setup.
it works when my href=www.server.com/index.php?Name=main
but will it work for me to change directories with it?
IE: <A href="index.php?Name=/deepDir/when">asdf</a>

obviously, I can't get it to. Any suggestions?

Code: Select all

<html>
<body bgcolor=white>
<center>
<? 
include "navigation.inc";
if (isset($Name))
	&#123;
		$name2 = $_GET&#1111;'Name'];
		$destination = $name2.".html";
		include $destination;

	&#125;else
	&#123;
		$destination = "main.html";
		include $destination;
	&#125;	

?>
</centeR>
</body>
</html>

Posted: Mon Mar 10, 2003 6:41 pm
by volka
take a look at http://www.php.net/manual/de/function.urlencode.php
But note that nothing prevents a user from entering something like
...index.php?Name=..%2Fsecret