simple variable passing question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
papasmurf
Forum Newbie
Posts: 4
Joined: Sun Feb 09, 2003 3:56 pm

simple variable passing question

Post 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>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
Post Reply