Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
| From: | Mark Clarkstone | Date: | Thu, 10 Jul 2003 17:13:15 +0000 |
| Subject: | Re: Continuing with HELP can someone tell me whats wrong here? (newbie) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154756@lists.php.net to get a copy of this message | ||
Its in cpconf.php
<?
$l33t = "C:/miniserve/Apache/conf/l33t.conf";
$syspath = "C:";
$install = "0";
$siteex = "MySite.Org";
$admin = "mini";
$adpw = "serve";
?>
"Shena Delian O'Brien" <shena@darklock.com> wrote in message
news:3F0D9BC0.2050002@darklock.com...
> Where are you passing the variable "install"? I can't see it in your
> form. Perhaps look for $check instead of $install?
>
> Mark Clarkstone wrote:
> > 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");
> > }
> > }
> > ?>
> >
> >
> >
>