Computing.Net > Forums > Programming > HTML Form/Button : PHP script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

HTML Form/Button : PHP script

Reply to Message Icon

Name: hyxodus
Date: February 13, 2005 at 18:13:46 Pacific
OS: Windows XP Pro SP1
CPU/Ram: P4 2.8GHz / 512mb
Comment:

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");
};
}



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: HTML Form/Button : PHP script

PHP Script and HTML Forms www.computing.net/answers/programming/php-script-and-html-forms/7635.html

How to save form settings (PHP) www.computing.net/answers/programming/how-to-save-form-settings-php/5265.html

PHP Question www.computing.net/answers/programming/php-question/10899.html