Jump to content

Just cant figure this one out. Please help me out


clown[NOR]

Recommended Posts

for some awsome reason this just wont work...  :) but I just can't figure out the reason why...

 

	<?php

		$include = "hjem.php";
		$vis = $_GET['vis'];
		if (isset($vis)) {
			$cs = explode("/", $vis);
			if (!empty($cs[1])) { 
				$include = str_replace("/", "", $vis);
			} else { $include = "$vis.php"; }
		}
		if (!file_exists($include)) { $include = "missing.php"; }
		require_once($include);

	?>

 

Notice: Undefined index: vis in /web/sirkulus/beta/index.php on line 56

 

Thanks In Advance

- Clown

	<?php

		$include = "hjem.php";
		if (isset($_GET['vis'])) {
        			$vis = $_GET['vis'];
			$cs = explode("/", $vis);
			if (!empty($cs[1])) { 
				$include = str_replace("/", "", $vis);
			} else { $include = "$vis.php"; }
		}
		if (!file_exists($include)) { $include = "missing.php"; }
		require_once($include);

	?>

 

It is the $_GET you have to check for isset as that is the array with the "unknown" index.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.