Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. is the $_GET['ID'] the ID from the attacker ?
  2. remember i can't test this,.. ok i have reviewd everything (i think) Wait noticed a ton some fo the logic is a little weird! would you mind if i update a few thing ?
  3. maybe http://www.imagemagick.org/script/index.php
  4. i made a few updates, try now
  5. lol opps updated it
  6. ok try this <?php include('inc/header.php'); $eID = $enemy->ID; $uID = (int)$_GET['ID']; if ($uID > 0) //changed { $enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$eID'"); $enemy = @mysql_fetch_object($enemysql); $usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); $user = @mysql_fetch_object($usersql); echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>"; }else{ die("error"); } if ($enemy->ID == $user->ID) { echo' You cant attack yourself!'; } elseif ($user->hp <= 0) { echo ' You are in NO condition to do battle'; } elseif ($enemy->hp = 0) { echo ' Your Enemy Is Already Dead!'; } elseif ($user->energy <= 4) { echo ' Not enough energy!'; } elseif ($user->attack < $enemy->defense) { echo ' You look at your opponent, and wet your pants at his/her strength. You lose the battle.<br><br><br><br><br><br><br><br><br>'; mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$user->ID'"); } elseif ($user->defense > $enemy->attack) { echo' Your opponent takes one look at you, and dies in fear<br><br><br><br><br><br><br><br><br>'; mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$_GET[iD]'"); } else { echo' Welcome to the Battle Arena.'; if ( $user->agility > $enemy->agility) { $firstattack = '1'; }else{ $firstattack = '2'; } echo "User HP:".$user->hp; echo "<br>Enemy HP:".$enemy->hp; while ($user->hp > 0 && $enemy->hp > 0) { $enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); $enemy = @mysql_fetch_object($enemysql); $usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); $user = @mysql_fetch_object($usersql); echo "attack<br>"; //add flush(); //add if ($firstattack == 1) { $dmg = ($user->attack) - ($enemy->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $_GET[iD]"); echo "$user->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$enemy->display_name"; } if ($firstattack == 2) { $dmg = ($enemy->attack) - ($user->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $user->ID"); echo "$enemy->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$user->display_name"; } if ($firstattack != 1) { $dmg = ($user->attack) - ($enemy->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $_GET[iD]"); echo "$user->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$enemy->display_name"; } if ($firstattack != 2) { $dmg = ($enemy->attack) - ($user->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $user->ID"); echo "$enemy->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$user->display_name"; } } } include('inc/footer.php'); ?>
  7. can you echo "enemy"; print_r($enemy); echo "user"; print_r($user); and post the result from that i think their around the wrong way!
  8. have you tried print_r($_POST); at the start to help with debugging ?
  9. change the $enemy->ID to $enemy['ID'] $enemy->hp to $enemy['hp'] etc etc etc etc try a few and check it works then continue EDIT AHHH wait a sec.. echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>"; worked ! *thinking* try print_r($enemy), and post the result from that
  10. use the # button (on the toolbar) AKA [quote author=MadTechie link=topic=154575.msg669149#msg669149 date=1187009615] if you dont get a message "IN the WHILE LOOP " then your values are lower than 0, comment that line out and see what happens [/quote] add to the start [code] echo "User HP:".$user->hp; echo "<br>Enemy HP:".$enemy->hp; your see the theirs no value are you including the class ?
  11. OK add this if ( $user->agility > $enemy->agility) { $firstattack = '1'; } else { $firstattack = '2'; } while ($user->hp > 0 && $enemy->hp > 0) { die("IN the WHILE LOOP ");//ADD THIS echo "attack<br>"; //add flush(); //add if ($firstattack == 1) { $dmg = ($user->attack) - ($enemy->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $_GET[iD]"); echo "$user->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$enemy->display_name"; } if ($firstattack == 2) { $dmg = ($enemy->attack) - ($user->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $user->ID"); echo "$enemy->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$user->display_name"; } if ($firstattack != 1) { $dmg = ($user->attack) - ($enemy->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $_GET[iD]"); echo "$user->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$enemy->display_name"; } if ($firstattack != 2) { $dmg = ($enemy->attack) - ($user->defense); mysql_query("UPDATE `users` SET hp = hp-($dmg) WHERE ID = $user->ID"); echo "$enemy->display_name"; echo' has done '; echo "$dmg"; echo ' damage against '; echo "$user->display_name"; } } if you dont get a message "IN the WHILE LOOP " then your values are lower than 0, comment that line out and see what happens
  12. maybe ask a java forum!! unless you mean javascript, then no maybe mailto: <a href="email@domain.com">
  13. what about jpeg2wbmp if you are after WBMP.. if not then i think i found one awhile ago (will search my computer)
  14. never ending loop, you need to update the values for $user->hp $enemy->hp
  15. won't do TIFF and it does say BMP but its using the GD library so i think thats only WBMP
  16. LOL, i was goin to reply with "What ?" but didn't its true what is the "problem" ?
  17. LOL Cool,
  18. really need more info, try this and post the results //added print_r($_FILES); die("END"); switch($mimetype) { case "image/jpg": $i = imagecreatefromjpeg($temporary_name); case "image/jpeg": $i = imagecreatefromjpeg($temporary_name); case "image/pjpeg": $i = imagecreatefromjpeg($temporary_name); break; case "image/gif": $i = imagecreatefromgif($temporary_name); break; case "image/png": $i = imagecreatefrompng($temporary_name); break; default: die("FAILED: Bad mimetype"); }
  19. have a simple database to store votes and have a email field, when someone votes display a message saying , that like will validate the email and the vote (bit like user remembership activation) does that make more sence ?
  20. change switch($mimetype) { case "image/jpg": case "image/jpeg": case "image/pjpeg": $i = imagecreatefromjpeg($temporary_name); break; case "image/gif": $i = imagecreatefromgif($temporary_name); break; case "image/png": $i = imagecreatefrompng($temporary_name); break; } to switch($mimetype) { case "image/jpg": $i = imagecreatefromjpeg($temporary_name); case "image/jpeg": $i = imagecreatefromjpeg($temporary_name); case "image/pjpeg": $i = imagecreatefromjpeg($temporary_name); break; case "image/gif": $i = imagecreatefromgif($temporary_name); break; case "image/png": $i = imagecreatefrompng($temporary_name); break; }
  21. what about email account based ? of course you can setup 200 emails but thats time and effort.. just an idea
  22. but i could always enter bill.gates@microsoft.com thats a valid email but he may not of posted.. without sending an email and getting a reply i don't see how you can do this, side note: heres a nice email validator <?php function isValidAddress( $email, $check = false ) { if (!ereg('' . '^' . '[-!#$%&\'*+/0-9=?A-Z^_a-z{|}~]' . '(\\.?[-!#$%&\'*+/0-9=?A-Z^_a-z{|}~])*' . '@' . '[a-zA-Z](-?[a-zA-Z0-9])*' . '(\\.[a-zA-Z](-?[a-zA-Z0-9])*)+' . '$' , $email ) ) return false; list( $local, $domain ) = split( "@", $email, 2 ); if ( strlen($local) > 64 || strlen($domain) > 255 ) return false; if ( $check && !gethostbynamel( $domain ) ) return false; return true; } ?> @Wuhtzu, this is what you should use as will fail on a few check the examples i posted "^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$";
  23. try <?php if ($edit) { $sqledit="SELECT * FROM songs WHERE song_id=$edit"; $edresult=mysql_query($sqledit); $editrow=mysql_fetch_assoc($edresult); $editrow_song_album = $editrow['song_album']; $sqleditsa="SELECT * FROM albums WHERE album_id='$editrow_song_album'"; $resulteditsa=mysql_query($sqleditsa); $rowedsa=mysql_fetch_assoc($resulteditsa); ?> <table> <form action=editsongs.php?editsong=<? echo $edit ?>> <tr class="dark"> <th style="width: 55%">Song Name</th> <th>Album</th> <th>Order</th> </tr> <tr> <td><input type=text name="edname" value=<?php echo $editrow["song_name"] ?>></td><td> <select name="editsa_id"> <option selected=selected>Select an album...</option> <?php $sqlalist="SELECT * FROM albums ORDER BY album_id ASC"; $resultalist=mysql_query($sql); while ($rowalist=mysql_fetch_assoc($result)) { if ($roweditsa['album'] == $rowalist['album_id']) { $selecteda = 'selected="selected"'; } elseif ($roweditsa['album'] != $rowalist['album_id']) { $selecteda = ""; } ?> <option value="<?php echo $rowalist['album_id'] ?>" <?php echo $selecteda ?>><?php echo $row['album_name'] ?></option></td> <?php } // close while ?> </td><td><input type="text" name="edits_order" value="<?php echo $editrow['order'] ?>"></td></tr><tr><td><input type="submit" name="editsub" value="Submit"></form> <?php } // close IF ?>
  24. that RegEx won't work try if (preg_match('/^\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/si', $email)) { echo "valid"; } or fix the Wuhtzus one change ([a-z]{1-3}) to ([a-z]{1,3}) but the Wuhtzu's one will fail on a few ie metest@hotmail.coop me.test@hotmail.com or metest@nothing.com hello
  25. View the header, ie MIME-Version: 1.0 Received: from server.######.com ([64.####.####.197]) by bay0-mc7-f11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sat, 11 Aug 2007 01:23:22 -0700 Received: from ###.#######.net ([209.###.###.34])by server.######.com with esmtpa (Exim 4.67 (FreeBSD))(envelope-from <REAL@DOMAIN.com>)id 1IJmEo-0007Md-BZfor r#######@hotmail.com; Sat, 11 Aug 2007 08:22:22 +0000 X-Message-Delivery: Vj0zLjQuMDt1cz##2k9MDtsPTA7YT0w X-Message-Info: 6sSXyD95QpU8d/9lfRH5Aptnba##MGrqt1ZEPdUCYU6Hd+4ZLrT9PbaxeFYdmNvSRTFdXjLysBiPWr0S8uSg== X-Mailer: PHPMailer [version 1.73] X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - #############.com X-AntiAbuse: Original Domain - hotmail.com X-AntiAbuse: Originator/Caller UID/GID - [26 6] / [26 6] X-AntiAbuse: Sender Address Domain - #########.com X-Source: X-Source-Args: X-Source-Dir: Return-Path: webmaster@########.com X-OriginalArrivalTime: 11 Aug 2007 08:23:22.0241 (UTC) FILETIME=[E154BF10:01C7DBF0] i removed some details
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.