Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. reducing health would be a simple UPDATE however before I get into that.. I want to point something else out that you might not be aware of.. $Taijutsu_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Taijutsu'"); $Taijutsu_Rows= mysql_fetch_array($Taijutsu_Result); $Ninjutsu_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Ninjutsu'"); $Ninjutsu_Rows= mysql_fetch_array($Ninjutsu_Result); $Genjutsu_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Genjutsu'"); $Genjutsu_Rows= mysql_fetch_array($Genjutsu_Result); $Bloodline1_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Bloodline1'"); $Bloodline1_Rows= mysql_fetch_array($Bloodline1_Result); $Bloodline2_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Bloodline2'"); $Bloodline2_Rows= mysql_fetch_array($Bloodline2_Result); $Bloodline3_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Bloodline3'"); $Bloodline3_Rows= mysql_fetch_array($Bloodline3_Result); $Bloodline4_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Bloodline4'"); $Bloodline4_Rows= mysql_fetch_array($Bloodline4_Result); $Bloodline5_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$Bloodline5'"); $Bloodline5_Rows= mysql_fetch_array($Bloodline5_Result); could be shortened dramatically.. and save you a ton of performance most likely $result = mysql_query("SELECT * FROM `jutsus` WHERE `Jutsu_Name` IN ('$Taijutsu,$Ninjutsu,$Genjutsu,$Bloodline1,$Bloodline2,$Bloodline3,$Bloodline4,$Bloodline5')"); while ($a = mysql_fetch_array($result)) { $rows[] = $a; } NOW for that update get rid of this line: $Taijutsupower= mysql_real_escape_string($Taijutsupower); $Battle_Rows2['$Taijutsu_Power']; that will look for the literal string '$Taijutsu_Power' not whatever is contained within $Taijutsu_Power if this is really a variable remove the single quotes, if you meant NOT to put the $ in there, remove it and as for the update.. I can't figure out the uhm.. field in the MAIn database for the hp of the user.. so you'd hafta figure out that lil factor.. but your script NEEDS to update the database to tell the database the enemy's new HP value
  2. okay, many times you see many php tags because "echo" is four extra letters to type.. and also encasing (quoting) the output html.. E.G. <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'thematic')) ?></div> <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'thematic')) ?></div> you might have to escape "s and 's which is tedius also ?> ends that code block which makes anytthing after ?> normal html when you re-open <?php it picks the php interpreter back up and then everything inside becomes php code again.. php echoes into html, or outputs plain text so doing <?php ?> in various locations is completely fine.. in your examples you also showed the use of an if statement like: <?php // THIS IS PHP if (true) { ?> THIS IS NOW PLAIN TEXT BECAUSE OF THE ?> <html goes here> <?php // REOPENS PHP //CLOSES IF STATEMENT } ?> ^^ terminates php again although this works I advise you to stay away from this form of php construction, it could lead to many errors..
  3. xml would probably be used as rss from a forum which would probably be your most difficult procedure as for php mysql building a forum is as simple as storingpost details in a database.. and user information, the rest is outputting the data into html format with php sorry if I sound ramblish but its really simplistic you really don't need a tutorial you just should give some brain power and you'll be fine
  4. this will be moved, to opensource help
  5. date("Y-m-d",strtotime("10/5/1990"));
  6. I am not seeing what you need this for: if (in_array($mainSocket, $readSockets)) /* one or more clients hitting the main socket for a connection */ { // get each new connection and set up a client object while (($newSocket = socket_accept($mainSocket)) !== false) { $clients[] = $newClient = new Client(); $newClient->socket = $newSocket; } } the if while (($newSocket = socket_accept($mainSocket)) !== false) { $clients[] = ($newClient = new Client()); $newClient->socket = $newSocket; }
  7. I'm assuming you HAVE this template available, your sort of "Product" template.. in which case, you could just do something like <?php // do your mysql query w\e here... if ($row = mysql_fetch_assoc($query)) { // dw about this.. put all the $row['field_names'] where they belong in the template } else { include("error.php"); die(); } ?> <div><?php echo $row['product_name']; ?></div>
  8. anytime bro, please click "SOLVED" below
  9. I just re-read your post, however, my script SHOULD work; you could just use strtotime() on your currently formatted date string, and that wioll return a unix timestamp for which you can use date() with in order to [re-]format your date
  10. ".$userArray[id]"'"; missing concactinator ".$userArray[id]."'"; and also you should get into the habbit of adding quotes to everything that SHOULD be quoted ".$userArray['id']."'";
  11. this is pushing a datatype related error, php handles datatype conversions as you attempt to convert them.. you could fix this by converting them into themselves but their numeric equivelent to the string versions return date("l, m.j.y @ H:ia", mktime(($hour * 1), ($minute * 1), ($second * 1), ($month * 1), ($day * 1), ($year * 1)));//error line
  12. do you have the tamper data plugin? installed on your firefox? if so you could do a simple differenciation between when data tampering occures, and a legitimate request.. E.G. comparing $_SERVER $_GET $_POST print_r() these and then post them here 1 set for tampered data, and 1 for legit request or add me to msn and I could help you in a more realtime mannar RussellonMSN [AT] hotmail.com
  13. tru dat but like.. I don't have to read over my own code, so that rule should probably only apply to the ppl asking.. but if it bothers you I'll take some initiative hey btw
  14. if it works than it works.. but md5 is a 1-way-hash so you can't recover the hash lol
  15. in the cert array function you could do function get_cert_array($index = null) { if ($index) { return $theArray[$index]; } else { return $theArray; } } thaut will make the arguement optional and then do something like echo $movies_base->get_cert_array('cert');
  16. php basics 101: php.. is a server side language.. meaning whatever happens on the server side (much like vegas) stays on the server side.. what is recieved by the client (web browser) is html or plain text, output by php. php can not run active with the client, once data gets output, php exits, and the browser handles the html/css/javascript.. what you can do is link to a javascript function.. which connects to aphp page via AJAX then does the actions you wanted php to do.. but you can not link directly to a specific php function unless you make a file with a bunch of functions, and send the function name via get then do $_GET['functionName'](arguements here); ^^ dunno if that'd work.. if not try $function = $_GET['functionName']; $function(arguements here);
  17. did you make these games, or do you have atleast the FLAs of these games? this way you could just trash the scores in the flash app.. so when the tamper data tries to re-send the last person's score.. the last person's score is non-existant
  18. $sql1 = mysql_query(sprintf("SELECT COUNT(DISTINCT ip) as uniqueCount, COUNT(ip) As allIps FROM stats WHERE owner_id = '%s' AND project_id = '%s' AND `date` >= DATE_SUB(CURDATE(),INTERVAL 1 MONTH) GROUP BY project_id", mysql_real_escape_string($row['owner_id']), mysql_real_escape_string($row['id'])))or die(mysql_error()); u could try this but I dont know if it'd work ;P
  19. Is this a flash game by any chance?
  20. usually firefox extensions are accessible through javascript if you look up the documentation on tamper data you might find a way to locate it.. but that only works if javascript is enabled.. probably you could impliment a sort of ticketing system where everytime a score is sent, generate a new random number, and have your server send that random number back to the game, then have php expect that random number on the next sent scores.. this way tamper data will most likely not be able to retrieve and send this unique number, thus rendering it useless
  21. I figured you wanted it to show when it didn't find it.. remove the else statement all together $array=array('first','second','third','3423a','76676'); foreach($array as $arrays){ $result=strpos($arrays,'76'); if($result!==false){ echo 'found it<br />'; die; } }
  22. don't give up on the dates thing, but settle for the upload time medium and, are you unlinking the correct path? e.g. in your database you have "filename" but that isn't the full path from where the script is being executed most likely.. it is probably in a folded like /db_files/ so you'd prepend all your filenames from the database which are to be deleted with "/db_files/" LIKE SO: unlink("/db_files/".$mysql_assoc_row['filename']);
  23. heyyy my name is Russell alsooo waddup twindawg lol SELECT * FROM `classes` JOIN `courses` ON (courses.cou_ID = classes.cl_course) try that =o
  24. you're not finding it because first comes before second, and "sec" doesn't exist in "first" and either way if it matches or doesn't match, you die() the script.. take the die() out of the else statement and you should be okay.. <?php $array=array('first','second','third','3423a','3423'); foreach($array as $arrays){ $result=strpos($arrays,'sec'); if($result!==false){ echo 'found it<br />'; die; } else { echo 'NOT found it<br />'; } } ?>
×
×
  • 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.