Continuing with HELP can someone tell me whats wrong here? (newbie)
| From: | Mark Clarkstone | Date: | Thu, 10 Jul 2003 16:53:43 +0000 |
| Subject: | Continuing with HELP can someone tell me whats wrong here? (newbie) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154753@lists.php.net to get a copy of this message | ||
now the script works but won't write to the file just returns to the form.
<title> Control Panel</title>
<font face=\"Tahoma\" size=\"2\">
<?
require("cpconf.php");
if ($install=="0") {
print "<p><font size=\"2\" face=\"Tahoma\"><b>Welcome to
The Control Panel
Installer<br>
<br>
</b>This will install the control Panel</font></p>
<form method=\"POST\" action=\"?action=check\">
<font face=\"Tahoma\" size=\"2\">Please enter your site domain e.g.
freesite.cjb.com (without a www or a dot please) leave as localhost if you
are
using it as a local testing server.</font><br>
<input type=\"text\" name=\"csiteex\" size=\"20\"
value=\"localhost\"><br>
<br>
<font size=\"2\" face=\"Tahoma\">Please enter a Username &
password to
access the
area<br>
Username<br>
<input type=\"text\" name=\"user\" size=\"20\"><br>
Password<br>
<input type=\"text\" name=\"pass\"
size=\"20\"></font><br>
<input type=\"submit\" value=\"Submit\" name=\"B1\"></p>
</form>";
}
else if ($action=="check") {
if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else {
$data = "<?
\$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
\$syspath = \"C:\";
\$install = \"1\";
\$siteex = \"$csiteex\";
\$admin = \"$user\";
\$adpw = \"$pass\";
?>";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
echo "Done!";
}
}
else if ($install =="1") {
echo "<p><font size=\"2\" face=\"Tahoma\"><b>Welcome to
The Control
Panel</b></font></p>
<form method=\"POST\" action=\"?login=check\">
<font size=\"2\" face=\"Tahoma\">Please enter a Username &
password to
access the
area<br>
Username<br>
<input type=\"text\" name=\"userlogin\" size=\"20\"><br>
Password<br>
<input type=\"text\" name=\"passlogin\"
size=\"20\"></font><br>
<input type=\"submit\" value=\"Submit\" name=\"B1\"></p>
</form>";
}
else if ($login=="check") {
if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php");
}
}
?>