melistik
Erfahrenes Mitglied
Ich möchte gern die Funktion :
und dieses Forumlar :
in einer install.php Datei zusammenfassen. Wie geht soetwas ?
PHP:
<?php
$file = $dbconfig;
$config = fileperms ($file);
if ($pw1 != $pw2)
{ echo "<center>pws falsch nicht übereinstimmend!</center>";
return;
}
else { $pw = $pw1;}
if ($config != 33279)
{ echo "<center>cmod 777 nicht gesetzt !</center>";
return;
}
$fp = fopen ("$file","w");
flock ($fp, LOCK_EX) ; // sperren
fwrite ($fp, "$banner");
fwrite ($fp, "|--|");
fwrite ($fp, "$dbconfig");
fwrite ($fp, "|--|");
fwrite ($fp, "$pw");
fwrite ($fp, "|--|");
fwrite ($fp, "$dbposts");
fwrite ($fp, "|--|");
flock ($fp, LOCK_UN); // öffnen
echo "<center>Setup ist fertig bitte lösche setup.php und setup.html</center>";
?>
PHP:
<html><head>
<meta http-equiv="Content-Language" content="de">
<link href="style.css" rel="stylesheet" type="text/css">
<title>setup</title>
</head><body>
<form method="POST" action="setup.php">
<div align="center">
<center>
<table id='setupb' cellpadding="1" cellspacing="1">
<tr><td height="18"><i>
<font id="setupi">Grundsätzliches Design:</font></i></td>
<td width="120"></td>
</tr><tr><td height="1"><font id="setupi">banner</font></td>
<td width="120"><font id="setupi">
<input type="text" name="banner" size="20" id="input"></font></td>
<td height="1"><font id="setupi">Banner Pfad
angeben http://...</font></td>
</tr><tr><td height="18"></td><td width="120"></td>
</tr><tr><td height="18"><i>
<font id="setupi">Ordner/Pfade:(prinzipiell so lassen!)</font></i></td>
<td width="120"></td></tr><tr>
<td height="18"><font id="setupi">db-config.dat</font></td>
<td width="120"><font id="setupi">
<input type="text" name="dbconfig" id="input" size="20" value="db/config.dat"></font></td>
<td height="18"></td></tr><tr>
<td height="18"><font id="setupi">db-posts.dat</font></td>
<td width="120"><font id="setupi">
<input type="text" name="dbposts" id="input" size="20" value="db/posts.dat"></font></td>
<td height="18"></td></tr><tr><td height="18"></td>
<td width="120"></td></tr><tr><td height="1"><i>
<font id="setupi">Adminbereich:</font></i></td>
<td width="120"></td></tr><tr>
<td height="18"><font id="setupi">pw</font></td>
<td width="120"><front id='setupi'>
<input type="password" name="pw1" id="input" size="20"></font></td>
<td height="18"><font id="setupi">Passwort</font></td></tr><tr>
<td height="18"><font id="setupi">pw</font></td>
<td width="120"><front id='setupi'>
<input type="password" name="pw2" id="input" size="20"></td>
<td height="18"><font id="setupi">Passwort erneut</font></td></tr></table>
</center></div><p align="center"><input type="submit" value="setup" id="button" name="post"><input type="reset" value="back" id="button" name="back"></p>
</form></body></html>