<?php
session_start();
?>
<html>
<head>
<title>ScriptzNET.nl</title>
<link href="http://
www.scriptznet.nl/stylesheets/input.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/body.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/scrollbars.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/link.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/alink.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/vlink.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/bold.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/stylesheets/table.css" rel="stylesheet" type="text/css">
<link href="http://
www.scriptznet.nl/icons/favicon.ico" rel="shortcut icon">
<link href="http://
www.scripzsnet.nl/icons/favicon.ico" rel="icon">
<meta http-equiv="charset" content="ISO-8859-1">
<meta http-equiv="content-language" content="dutch">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript">
defaultStatus = "ScriptzNET";
</script>
</head>
<body>
<div align="center">
<?php
$mysql_gebruikersnaam = "scriptzn_root";
$mysql_wachtwoord = "yw34sn78";
$mysql_host = "localhost";
$mysql_database = "scriptzn_administratie";
if (!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_gebruikersnaam, $mysql_wachtwoord))) {
$invoegen_verandering = "INSERT INTO veranderingen SET verandering_id = '', administrator_id = '$_SESSION[administrator_id]', voormalige_code = '$voormalige_code', datum = '$datum'";
$resultaat_invoegen_verandering = mysql_query($invoegen_verandering);
if (isset($_SESSION["administrator_id"]) && isset($_SESSION["gebruikersnaam"])) {
echo "
<b>
Pagina bewerken
</b>
<br />
<form action='$PHP_SELF' method='post'>
<table>
<tr>
<td>
directory:
</td>
<td>
<input type='text' name='directory' value='/home/scriptzn/www/' />
</td>
</tr>
<tr>
<td>
bestand:
</td>
<td>
<input type='text' name='bestand' />
</td>
</tr>
<tr>
<td colspan='2'>
<input type='submit' name='submit' value='open' />
<input type='reset' name='reset' value='wissen' />
</td>
</tr>
</table>
</form>
";
if ($_POST["submit"]) {
if ($_POST["bestand"] && $_POST["directory"]) {
if (ereg("^[/home/scriptzn/www/]", $_POST["directory"])) {
if (ereg("[administratie/]$", $_POST["directory"])) {
echo "
<b>
Fout
</b>
<br />
Kan het CMS niet aanpassen!
";
}
else {
$bestand = $_POST["directory"];
$bestand += $_POST["bestand"];
if (file_exists($bestand)) {
header("Location: aanpassen.php");
}
else {
echo "
<b>
Fout
</b>
<br />
Bestand bestaat niet!
";
}
}
}
else {
echo "
<b>
Fout
</b>
<br />
Ongeldige directory!
";
}
}
else {
echo "
<b>
Fout
</b>
<br />
Je hebt geen bestand en/of directory opgegeven!
";
}
}
}
else {
echo "
<b>
Fout
</b>
<br />
Je bent niet ingelogd.
";
}
}
else {
echo "
<b>
Fout
</b>
<br />
Geen database connectie!
";
}
?>
</div>
</body>
</html>
Ik heb nu dit. Dit moet controleren of $_POST["directory"] met /home/scriptzn/www/ begint, en anders een foutmelding geven, en een foutmelding geven als hij eindigd op administratie/..... Alleen werkt het niet echt...