Thread: Admin Script

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    Can someone PLEASE make me a php admin script? when you go to the script it display a form that has username/pass. And then you login and you're in the admin area. Thanks!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    9
    Rep Power
    0
    Here is a pretty straightforward script from thickbook.com that queries a mysql database.

    login.html:


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <HTML>
    <HEAD>
    <TITLE>My Login Form</TITLE>
    </HEAD>

    <FORM ACTION="login.php" METHOD="post">

    <table border=0>
    <tr>
    <td><strong>Username</strong></td>
    <td><input type="text" name="username" size="10" maxsize="10">
    </td>
    </tr>

    <tr>
    <td><strong>Password</strong></td>
    <td><input type="password" name="password" size="10" maxsize="10">
    </td>
    </tr>

    <tr>
    <td colspan="2" align="center">
    <input type="submit" value="Validate Me">
    </td>
    </tr>

    </table>

    </FORM>

    </BODY>
    </HTML>

    [/code]
    login.php:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <?

    $connection = mysql_connect("hostname", "username", "password")
    or die ("Couldn't connect to server.");

    $db = mysql_select_db("database_name", $connection)
    or die ("Couldn't select database.");

    $sql = "SELECT id
    FROM users
    WHERE username='$username' and password='$password'";

    $result = mysql_query($sql)
    or die("Couldn't execute query.");

    $num = mysql_numrows($result);

    if ($num == 1) {

    echo "<P>You are a valid user!<br>";
    echo "Your username is $username<br>";
    echo "Your password is $password</p>";

    } else if ($num == 0) {

    echo "You are not authorized!";

    }

    ?>

    [/code]

    ~Chris
    http://www.extremeforums.com

    [This message has been edited by TechTalk (edited July 06, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    Originally posted by GodsFshrmn:
    >Can someone PLEASE make me a php admin script?

    look for phpadmin (or was it called phpmyadmin?)
    good luck,
    Chris
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    24
    Rep Power
    0
    You can find phpMyAdmin and phpPgAdmin at http://www.phpWizard.net/

    -weeder

Similar Threads

  1. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 10:50 PM
  2. Perl script converting GIF and JPG images to BMP ???
    By Deanna475 in forum Perl Programming
    Replies: 20
    Last Post: February 17th, 2004, 06:35 PM
  3. Replies: 2
    Last Post: February 10th, 2004, 11:03 PM
  4. mod_rewrite and Apache 2 cgi script not working
    By jroamo in forum Apache Development
    Replies: 0
    Last Post: February 10th, 2004, 12:22 PM
  5. How can I enable a power user to run this script?
    By Yamadatroy in forum Visual Basic Programming
    Replies: 2
    Last Post: January 19th, 2004, 09:39 PM

IMN logo majestic logo threadwatch logo seochat tools logo