Results 1 to 2 of 2

Thread: Form Login Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    Michigan
    Posts
    143

    Unhappy Form Login Help

    Ok I have something that works now. I just need help with an error checking msg

    When the form button is clicked, as of now it does nothing. However, when clicked, I want it to say "bad username/password" if the user enters in the wrong combination.

    Any help?

    PHP Code:
    <html>
    <head>
    <title>Welcome To The Brose Control Panel</title>

    <style type="text/css">

    a:link {
    color: #C41F3A;
    text-decoration: none;
    }
    a:visited {
    color: #C41F3A;
    text-decoration: none;
    }
    a:hover {
    color: #C41F3A;
    text-decoration: underline;
    }
    .thankyou {
    font-family: Verdana, Arial;
    font-size: 13px;
    color: #C41F3A;
    text-align: right;
    }
    #hideme {
    font-family: Verdana, Arial;
    font-size: 13px;
    }

    .form {
    font-family: Verdana, Arial;
    font-size: 11px;
    }
    .formbutton {
    background-color: #C41F3A;
    color: #FFFFFF;
    }

    </style>
    <script language="javascript">
    <!-- Hide from older browsers

    // function to hide refi and purchase on page load

    function hideAll() {
     purchDiv.style.display='none';
     refiDiv.style.display='none';
    }

    // function to hide refi

    function showPurchase() {
     purchDiv.style.display='block';
     refiDiv.style.display='none';
     purchDiv.style.visibility='visible';
    }

    // function to hide purchase

    function showRefi() {
     refiDiv.style.display='block';
     purchDiv.style.display='none';
     refiDiv.style.visibility='visible';

    }
    // -->
    </script>


    </head>

    <body onload="hideAll()">

    <center><img src="http://dets2005/bna-intranet/images/logo.gif"></center><br /><br />

    <div id="hideme" align="center">
     <input type="radio" name="choice" class="radio" value="1" onClick="showPurchase();"> Bin Count Login
     <input type="radio" name="choice" class="radio" value="2" onClick="showRefi();"> Web Ticker Login 
    </div>


    <?php

    // Define your username and password
    $username "admin";
    $password "bin2004";

    if (
    $_POST['binUsername'] != $username || $_POST['binPassword'] != $password) {

    ?>


     <div id="purchDiv" style="visibility:hidden;">

    <br /><br />
    <form name="bin" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div align="center">
    <center>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td class="form">Username
    </td>
    <td><input type="text" title="Enter your Username" name="binUsername" size="13"/></td>
    </tr>
    <tr>
    <td class="form">Password
    </td>
    <td><input type="password" title="Enter your password" name="binPassword" size="13" /></td>
    </tr>
    </table>
    </center>
    </div>
    <p align="center"><input type="submit" name="Submit" value="Login" class="formbutton" /></p>
    </form>
    </div>


    <?php

    }
    else {

    ?>
     <div id="purchDiv" style="visibility:hidden;"></div>
     <script language="javascript">hideme.style.visibility='hidden';</script>
    <script language="JavaScript">
    <!--
    setTimeout("top.location.href = 'http://dets2008/bincount/click_test.php?action=admin'",5000);
    //--></script>
    <center><font class="thankyou">Please hold on a second while we redirect you...<br>
    If this page does not refresh in <b>3</b> seconds, <a href="http://dets2008/bincount/click_test.php?action=admin">click here</a>.</font></center>


    <?php
    }
    ?> 








    <?php

    // Define your username and password
    $username "demo";
    $password "demo";

    if (
    $_POST['tickerUsername'] != $username || $_POST['tickerPassword'] != $password) {

    ?>

     <div id="refiDiv" style="visibility:hidden;">
    <br /><br />

    <form name="ticker" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div align="center">
    <center>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td class="form">Username
    </td>
    <td><input type="text" title="Enter your Username" name="tickerUsername" size="13"/></td>
    </tr>
    <tr>
    <td class="form">Password
    </td>
    <td><input type="password" title="Enter your password" name="tickerPassword" size="13"/></td>
    </tr>
    </table>
    </center>
    </div>
    <p align="center"><input type="submit" name="Submit" value="Login" class="formbutton"/></p>
    </form>
    </div>


    <?php

    }
    else {

    ?>

    <div id="refiDiv" style="visibility:hidden;"></div>
    <script language="javascript">hideme.style.visibility='hidden';</script>
    <script language="JavaScript">
    <!--
    setTimeout("top.location.href = 'admin.php'",5000);
    //--></script>
    <center><font class="thankyou">Please hold on a second while we redirect you...<br>
    If this page does not refresh in <b>3</b> seconds, <a href="admin.php">click here</a>.</font></center>


    <?php
    }
    ?> 

    </body>
    </html>

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Are these supposed to be two different files, or is it all one big file?
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width