• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Files ueber URL inkludieren - Wie? Gefahren?

Status
Für weitere Antworten geschlossen.
ok wie wäre es mit
[php:1:e4958221bb]<?php include("./dateien/".ereg_replace("/", "", $_GET['seite']).".php"); ?>[/php:1:e4958221bb]
 
Werbung:
also ich habe so was:
[php:1:531c763b9f]<?php
$site=$_GET['site'];
if(!isset($site)) {
if(isset($_POST['site'])) {
$site=$_POST['site'];
} else {
$site="intro";
}
}
switch ($site) {
case "intro":
case "jwb":
case "crowd_groups":
case "crowd_leaders":
case "crowd_crowdleaders":
case "agenda":
case "news":
case "special":
case "flaepo":
case "photos":
case "links":
case "gb":
case "contact":
case "counter":
case "admin":
break;
default:
$site="f404";
}
include("txt/".$site.".php");
?>[/php:1:531c763b9f]
 
Werbung:
bei mir siehts so aus:

Code:
<?PHP
$titles = array(
	'german' => array(
		'agb' => array(
			'AGB',
			'agb_german'
		),
		'impressum' => array(
			'Impressum',
			'impressum_german'
		),
		'home' => array(
			'Home',
			'home_german'
		),
		'download' => array(
		'Download',
		'download_german'
		),
		'ad' => array(
		'',
		'ad'		
		)),
	'english' => array(
		'agb' => array(
			'AGB',
			'agb_english'
			),
		'impressum' => array(
			'Impressum',
			'impressum_english'),
		'home' => array(
			'Home',
			'home_english'
			),
		'download' => array(
		'Download',
		'download_english'
		)),
	'france' => array(
		'agb' => array(
			'AGB',
			'agb_france'),
		'impressum' => array(
			'Impressum',
			'impressum_france'),

		'home' => array(
			'Home',
			'home_france'
			),
		'download' => array(
		'Download',
		'download_france'
		)));
global $txt;
if(array_key_exists($_GET['action'], $titles[$txt['lng']]))
{
	send_html('Planet-Patchwork>>' . $titles[$txt['lng']][$_GET['action']][0]);
	load_file('./data/' . $titles[$txt['lng']][$_GET['action']][1] . '.tpl.php');
}
else
{
	send_html('Planet-Patchwork>>' . $titles[$txt['lng']]['home'][0]);
	load_file('./data/' . $titles[$txt['lng']]['home'][1] . '.tpl.php');
}
?>
load_file() gibt eigentlich nur den inhalt aus . (und noch ein paar andere sachen -deswegen nicht gleich readfile() )
eigentlich waren die titel im array auch in der jeweilgen sprache.. naja muss wohl was falsches erwischt haben
edit: dieser scheiss bbccode parser - ich krieg zuviel..
 
niklasboelter schrieb:
das ist komplizierter als die vorhergehenden ja - und was hast du uns jetzt damit bewiesen?
Es ist einfacher als die Vorhergehenden.

Du brauchst einfach nur z.B.:
Code:
<?php
$file=basename($_GET['file']);

include($file);
?>

Und niemand kann hacken.
 
Werbung:
Ist vielleicht ne blöde frage aber:
In welche datei muss ich das Kopieren?
[php:1:63efcb9a1f]<?php
<?php
switch ($_GET['datei']) {
case "kontakt":
include("kontakt.php");
break;
case "news":
include("news.php");
break;
// ... mehrere dateien in der selben art anreihen

// die standard datei
default:
include("haupt.php");
}
?>
?>[/php:1:63efcb9a1f]

In die datei auf der etwas includiert werden soll?
Oder auf der seite die includiert werden soll?
 
Dann kommt:

Parse error: parse error, unexpected '&', expecting T_CASE or T_DEFAULT or '}' in /home/manuelg/public_html/pc4um/index.php on line 72

Wohnst du wirklich in attinghausen ?
 
Werbung:
dreamweaver öffne einen neuen thread mit deinem problem. das hier is ein tutorial thread [...]
 
Status
Für weitere Antworten geschlossen.
Zurück
Oben