Navigation index.php?...

kalle01

Grünschnabel
Hi,

ich teste hier grade ein kleines MiniCMS und steh auf'n Schlach?
Hab mal das error-reporting reingesetzt und nun erhalte ich eine Meldung Undefined index: show. Ist ja logisch, an die index.php wird ja nichts angehangen. Hab nun kein Plan, wie ich das abstellen kann?

PHP:
<?php
error_reporting(E_ALL);
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*   Anzeige Funktionen fuer das miniCMS-Script   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

$url = $_GET["show"];

//Konfigurationsdaten
include("config.php");

$sql = "SELECT id,cms_title,url,keywords,text,position,date,showentry 
          FROM $tablename WHERE url='$url' AND showentry=1";
$result = mysql_query($sql, $db);
list($id,$cms_title,$url,$keywords,$text,$position,$date,$showentry) = mysql_fetch_row($result);

if (mysql_affected_rows() == 0) exit;

if ((int)$_GET['noheader'] == 0) include("inc/header.php");
echo parsePHP($text);
if ((int)$_GET['nofooter'] == 0) include("inc/footer.php");

function parsePHP($str)
{
	ob_start();
	$q = "?";
	$regex = "/<\\${q}php((.|\n)*?)\\${q}>/";
	preg_match_all($regex,$str,$out);
	$out = $out[1];
	$php = Array();
	$in = Array();
	while(list($num, $text) = each($out))
	{
		ob_start();
		eval("$text;");
		$php[] = ob_get_contents();
		$in[] = $regex;
		ob_end_clean();
	}

	return preg_replace($in,$php,$str,1);  
}
?>

So dann sag ich schon mal Danke :) für die Hilfe...

Gruss Kalle
 
ich würde das
PHP:
$url = $_GET["show"];
zu
PHP:
if(isset($_GET["show"])) $url = $_GET["show"];
ändern.
 
Zurück