SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the following is the coding from the script...i was wondering if someone could make a revision of it and tell me whats wrong and how to fix it? i have spent days slaving over this and still cant fix it. Thanks a lot.

    <?php
    /* this script is owned by Copyright Alien Web Design
    * no one is allowed to edit or modify this script without my consent
    * selling this script is prohibited and legal action may take place if caught
    */

    mysql_connect("localhost", "clanrage", "*********");
    mysql_select_db("clanrage");
    if (isset($submit)||isset($username)||isset($password)) {
    if ($username==""||$password=="") {
    print ("The username and/or password that was entered is incorrect.");
    } else {
    $check = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS isvalid FROM admin WHERE username='$username' AND password='$password'")) or die(mysql_error());
    if ($check['isvalid'] >= 1) {
    if ($action=="random") {
    ?>
    <table width="100%">
    <tr>
    <td>
    ID
    </td>
    <td>
    Username
    </td>
    <td>
    Password
    </td>
    <td>
    Random #
    </td>
    </tr>
    <?php
    $playnum = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS playernum FROM signups WHERE date='$date' AND game='$game'")) or die(mysql_error());
    $sql = "SELECT * FROM signups WHERE date='$date' AND game='$game'";
    $result = mysql_query($sql);
    $ct=0;
    $cnt=$playnum["playernum"];
    srand ((double) microtime() * 1000000);
    while ($ct<=$cnt) {
    $num=rand(1,$cnt);
    $checkrandom = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS randomnumber FROM signups WHERE randomnum='$num'")) or die(mysql_error());
    if ($checkrandom['randomnumber'] >=2) {
    } else {
    mysql_query("UPDATE signups SET randomnum='$num' WHERE user_id='$num'") or die(mysql_error());
    }
    $ct++;
    }
    while ($tourn = mysql_fetch_array($result)) {
    ?>
    <tr>
    <td>
    <?php print($tourn["user_id"]); ?>
    </td>
    <td>
    <?php print($tourn["username"]); ?>
    </td>
    <td>
    <?php print($tourn["password"]); ?>
    </td>
    <td>
    <?php print($tourn["randomnum"]); ?>
    </td>
    </tr>
    <?php
    }
    ?>
    </table>
    <?php
    } else {
    ?>
    <table width="100%">
    <tr>
    <td>
    Random
    </td>
    <td>
    ID
    </td>
    <td>
    Date
    </td>
    <td>
    # of players
    </td>
    <td>
    Game
    </td>
    <td>
    Description
    </td>
    </tr>
    <?php
    $sql = "SELECT * FROM admin WHERE open='no'";
    $result = mysql_query($sql);
    while ($tourn = mysql_fetch_array($result)) {
    ?>
    <tr>
    <td>
    <a href="random.php?action=random&date=<?php print($tourn["date"]); ?>&game=<?php print($tourn["game"]); ?>&username=<?php print($username); ?>&password=<?php print($password); ?>">Random</a>
    </td>
    <td>
    <?php print($tourn["user_id"]); ?>
    </td>
    <td>
    <?php print($tourn["date"]); ?>
    </td>
    <td>
    <?php print($tourn["players"]); ?>
    </td>
    <td>
    <?php print($tourn["game"]); ?>
    </td>
    <td>
    <?php print($tourn["description"]); ?>
    </td>
    </tr>
    <?php
    }
    }
    print("</table>");
    } else {
    print ("The username and/or password that was entered is incorrect.");
    }
    }
    } else {
    ?>
    <html>
    <head>
    <title>Pairing The Members</title>
    </head>

    <body>
    <form action="random.php" method="post" enctype="application/x-www-form-urlencoded">
    Username: <input type="text" name="username" size="30"><br><br>
    Password: <input type="password" name="password" size="30"><br><br>
    <input type="submit" name="submit" value="Log In">
    </form>
    </body>
    </html>
    <?php
    }
    ?>
    Last edited by GoD; Feb 15, 2001 at 20:46.

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the problem? Since you just said to look at the script w/o saying specific problem you are having w/ it.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh, this that your password in there? I'd edit that ASAP!

    And yes, we're gonna need an error message/output summary here.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh well tis a test DB anyways...but i found help thanks anyways guys


Bookmarks

Posting Permissions

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