Jump to content

StormTheGates

Members
  • Posts

    170
  • Joined

  • Last visited

Everything posted by StormTheGates

  1. Does anyone know of a way to send an AOL Instant Messenger message through PHP? What I am trying to do is have a script that counts something down, then when its done message an AIM account informing them that it has finished. Any ideas?
  2. I compiled a while ago apache 2.2.4 without SSL support. Now about a year later I regret it. Is there any way to add this library in without recompiling Apache? I dont want to take my site down for very long or ruin any of the configs or php installs Ive got on it. Maybe a mod_ssl rpm would work?
  3. So you think I should just do all the minor calculations through the SQL and ditch the selecting part?
  4. Ive always wondered this. There are two methods that Ive used, one in the past and now the newer one to update things. Here is my old way: <?php $train = mysql_query("SELECT soldiers, guards, workers, scientists FROM followerstats WHERE username='$username' AND family='$family'")or die("Something fucked up, contact Wolf!"); while($success = mysql_fetch_row($train)){ $usold = $success[0]; $uguard = $success[1]; $uwork = $success[2]; $usci = $success[3]; } $usold = $usold + $soldsgot; $uguard = $uguard + $guardsgot; $uwork = $uwork + $workersgot; $usci = $usci = $scisgot; $total = $usold + $uguard + $uwork + $usci; mysql_query("UPDATE followerstats SET soldiers='$usold', guards='$uguard', workers='$uwork', scientists='$usci', total='$total' WHERE username='$username' AND family='$family'")or die(mysql_error()); ?> And here is my new way: [code] <?php $total = $total + $workersgot + $soldiersgot + $guardsgot + $scientistsgot; mysql_query("UPDATE followerstats SET soldiers=soldiers+$soldiersgot, guards=guards+$guardsgot, workers=workers+$workersgot, scientists=scientists+$scientistsgot, total='$total' WHERE username='$username' AND family='$family'")or die(mysql_error()); ?> Which way is faster in the long run do you think? I am considering going through my code and converting things like the first method into things like the second method. Is this a good idea?[/code]
  5. Ive got a list of checkboxes that I need to loop through. So heres what Ive done so far. <?php echo "$_POST[idofcar]"; foreach ($_POST['idofcar'] as $key => $value) { die("This is working!"); } ?> When this is run the ID of the car from the checkbox will run fine, and say 19 or whatever. But then it will not die which means that it is not going into the loop. Any ideas why?
  6. Well I have roughly 500 visitors a day doing PHP and HTML related activites and we use about 400megs a month of bandwidth. So thats roughly 13megs a day per 500 users. So if you are expecting 50-500k then your talking a whole heap of bandwidth needs.
  7. I believe you can input php variables into javascript like this. <script language="javascript"> houseprice = <?php echo "$houseprice"; ?> </script> Not entirely sure though.
  8. Have you tried the session with ""s? $_SESSION["$variable"]; Not sure if it will make a difference.
  9. I always put in an autoinc ID field. Makes sorting and managing things in the future much easier. And really any overhead it adds is negligible.
  10. It looks like you are missing the field variable for them? $fields{"Type"} = "Types";
  11. Whenever a user clicks $time = time(); mysql_query("UPDATE users SET lastaction='$time' WHERE username='$username'"); Then when you check to see if they are on or off $s = mysql_query("SELECT lastaction FROM users WHERE username='$username'"); while($r = $mysql_fetch_row($s)){ $last = $r[0]; } $range = time()-600; if($range < $last){ echo "User is online!"; } else { echo "User is offline!"; }
  12. Always gotta watch out about blending mysql command words with data names.
  13. With MYSQL I would have a cell called lastaction and then everytime they click have it update to the current time. Then when you want to show them as online or offline have it compare the lastaction time to like time()-600 for within 10mins.
  14. http://kore-nordmann.de/blog/image_creation_with_php_texts.html Or maybe just google around a little for PHP GD text on image.
  15. Well if you had a defining thing in your database like "location" you could pass it with a $_GET variable. viewvenu.php?location=Place Then get everything with the location Place from your database.
  16. You can use GD to lay text over a background and then make then render it as an image in the browser.
  17. It looks to me as though your call is above your function declaration. $wh = imageResize($image_t[0], $image_t[1], 100); function imageResize($width, $height, $target) { Maybe put the function above the call?
  18. Also in regards to counting sessions there are two ways to do it. One way is to get the bulk number of sessions, here is a tutorial: http://www.devarticles.com/c/a/PHP/The-Quickest-Way-To-Count-Users-Online-With-PHP/ Another way is to have a place on your database for each user called lastactive or something. Then check through each person on the database to see when they were last active, and if it was within the last 10 mins count it up in a variable.
  19. Well for your first question you could use Unions to bind the SQL query into 1. SELECT u.count(ID) as UsrNum, l.count(ID) as LogNum FROM `users u`, `loggers l`; Atleast I think that is the right syntax
  20. Well if you want to make sure that words are not split then I would say perhaps checking the character before and after your 130 mark to see if either is equal to a space? If not then read over one more until one of the surrounding chars equals a space, that will indicate the word has ended. You could also check for commas or colors or periods or whatever.
  21. Check your Listen directives in the .conf files. But honestly if you want to set up a quick direct test environment on your computer just get and install XAMP. It will install Apache, PHP, and MySQL for you.
  22. Maybe for different configs or software addons? PHP4 and PHP5? Dunno. Here is a guide: http://ez.no/developer/articles/multiple_apache_installations_howto
  23. Uhm are you sure your Apache is listening on port 80? Check the conf file.
×
×
  • 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.