Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP
#1
Code:
if (!$_REQUEST["Admi"]) echo '<a href="login.php">login</a> is needed to use this page.';
if ($_REQUEST['Admi']);
{
echo '<form action="upload_file.php" method="post"enctype="multipart/form-data">';
echo '<label for="file">Filename:</label>';
echo '<input type="file" name="file" id="file" />';
echo '<br />';
echo '<input type="submit" name="submit" value="Submit" />';
echo '</form>';
}

It does say "login is needed to use this page", but it also echos the form...
Reply
#2
(07-21-2011, 08:46 PM)roperson Wrote:
Code:
if (!$_REQUEST["Admi"]) echo '<a href="login.php">login</a> is needed to use this page.';
if ($_REQUEST['Admi']);
{
echo '<form action="upload_file.php" method="post"enctype="multipart/form-data">';
echo '<label for="file">Filename:</label>';
echo '<input type="file" name="file" id="file" />';
echo '<br />';
echo '<input type="submit" name="submit" value="Submit" />';
echo '</form>';
}

It does say "login is needed to use this page", but it also echos the form...

Take out the semicolon in the second line.
Reply
#3
Worked. Big Grin
Now, the login page won't work....

Code:
$id="*";
        if($_POST['pwd']==$id);
        setcookie("admi", "Yes", time()+3600);
        echo "Yes";
        else
        echo "No";
Reply
#4
(07-21-2011, 09:03 PM)roperson Wrote: Worked. Big Grin
Now, the login page won't work....

Code:
$id="*";
        if($_POST['pwd']==$id)
        {
            setcookie("admi", "Yes", time()+3600);
            echo "Yes";
        }
        else
            echo "No";

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)