Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am having problems with my PHP script.
After entering login and password information into 2 input boxes from a form and posting the data to a php script, login.php, the script checks the username and password.
After seeing the username and password are both 'admin' it 'logs in' as admin and is supposed to give a welcome message and 3 buttons.
Don't worry what these three buttons need to do, it's some MYSQL stuff, but right now I just want these three buttons to do ANYTHING. I think the problem is... is that these 3 buttons (form) are in a .php script file. Anyways, after I press any of the 3 buttons, instead of doing what I want them to do (a few more php commands to display some info), they just wipe out any output that was currently on the page.
Here is the code from the login.php file that I am talking about.
if (( $name == "admin" ) && ( $pass1 == "admin" ))
{
//Display success
printf("\nYou have logged in as the admin!\n");//Do admin stuff
?>
<FORM>
Dump list of registered users
<INPUT type="submit" name="dumpreg" value="dump">
List login failures
<INPUT type="submit" name="listfail" value="list">
List last successful login per user
<INPUT type="submit" name="listsuc" value="list">
</FORM>
<?
if ( isset($_REQUEST['dumpreg']) )
{
printf("\ndumping registered users...\n");};
if ( isset($_REQUEST['listfail']) )
{
printf("\nlisting login failures...\n");
};
if ( isset($_REQUEST['listsuc']) )
{
printf("\nlisting last successful logins...\n");
};
}

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |