Jump to content

Steve Scrimpshire

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by Steve Scrimpshire

  1. I have my cache set to 0, but just for grins and giggles, I cleared it anyway. Made no difference.
  2. Wasn't sure where to put this, but since about 2-3 weeks ago, the forum's header is messed up for me. Not a huge issue, but annoying nonetheless. Here is a screenshot: http://semperphi.com/tch-header.png I'm using Firefox 1.5.0.6 on Mandriva Linux at 1024 x 768.
  3. When we finally do get Ruby on Rails here on the servers, does this mean that Ruby cgi scripts will also be possible other than just Rails applications? I'm waiting patiently for the two weeks to be up that started a month and a half ago.
  4. For reference purposes, I am in Southern MS, using Comcast cable internet and it timed out for me trying to upload a file called test.fib (8.8M) at 31.823 seconds. You can refer the helpdesk to me, if they want to verify that it is not just you. My domain is http://semperphi.com
  5. If you do a Repair with the XP disk, make sure she physically has the XP product key. Otherwise, if she has installed Service Pack 2 or later (which I personally despise), trying to use a utility to recover her product key from the registry gives you a false number, thanks to SP2. It's possible the repair will work, but it may have been some other program's installation that corrupted the registry. In other words, I give you an 70% chance that a 'repair' will work. +5% if both drives are seen by the BIOS.
  6. So, when you say 'no luck', I am assuming you mean that it won't boot from the HD on the second ide? Plug the two drives back on the second ide like they were originally and see if you can look into the BIOS settings. If the BIOS sees them, then this is a Windows problem, more than likely. On Dell's to get into the BIOS, here are the 3 most common key-combos: F1 or Del. Some require pressing reset twice Dell: - Ctrl + Alt + Enter
  7. Have you tried switching which IDE controller they are on? Also, make sure you try each one alone on the controller. One bad drive (even intermittently) can cause the other to not operate correctly.
  8. I think this will help: http://www.phpclasses.org/browse/package/1351.html
  9. Selected them from the database sorted the way you want should do away with the need for a cron script (except the cron script to update the database with new values, of course) and they are sorted dynamically. My apologies if this is not what you are intending.
  10. You also may want to consider selecting it from your database in the order you want. I'm assuming you are using MySQL: >SELECT Username, Attack, Defense, Spy, Sentry FROM Users ORDER BY Attack, Username This should start the new array sorted by attack and if two users have the same attack rating, they are sorted alphabetically.
  11. I tested this on my linux box at home (Intel 2.66 GHz with 512 MB RAM) and the script uses 30% CPU for .95 seconds with 1800 users in the array.
  12. ><?php $arrStats=array(); $arrStats[1]['username']="Bob"; $arrStats[2]['username']="Bill"; $arrStats[3]['username']="John"; $arrStats[1]['attack']=150; $arrStats[2]['attack']=200; $arrStats[3]['attack']=75; $arrStats[1]['defense']=250; $arrStats[2]['defense']=50; $arrStats[3]['defense']=980; function Defense($a, $b) { if ($a['defense'] == $b['defense']) { return 0; } return ($a['defense'] > $b['defense']) ? -1 : 1; } function Attack($a, $b) { if ($a['attack'] == $b['attack']) { return 0; } return ($a['attack'] > $b['attack']) ? -1 : 1; } usort($arrStats, "Defense"); while (list($key, $value) = each($arrStats)) { echo $value["username"] . " (Defense: " . $value["defense"] . ")\n"; } usort($arrStats, "Attack"); echo "\n"; while (list($key, $value) = each($arrStats)) { echo $value["username"] . " (Attack: " . $value["attack"] . ")\n"; } echo "\n"; ?> See how that works out for ya. Edit: The only problem for me is if two usernames have the same attack as each other (or defense), then they are sorted randomly and not alphabetically. Also, if you are outputting this as html, of course every instance of "\n" should be <br>.
  13. Maybe array_multisort? http://us3.php.net/manual/en/function.array-multisort.php or uasort? http://us3.php.net/uasort
  14. Does this happen every time you go to any site for the first time or is it random? Does it only happen on the desktop or the laptop or is this a completely different system from either listed in your 'home network problem' topic? Was this the same computer that was once connected 10/100 wired? Do you have your router configured to get an IP from your ISP through DHCP? What ISP?
  15. As a matter of fact, it is a good idea to not name them the same thing, because you will get confused: >function my_function($var_1){ $var_1 = 13; echo "Inside the function \$var_1 equals $var_1\n"; return; } $var_1=11; my_function($var_1); echo "Outside the function \$var_1 still equals $var_1\n"; Outputs: >Inside the function $var_1 equals 13 Outside the function $var_1 still equals 11
  16. No offense to Dick, but it is a bad habit to get into declaring global variables inside functions. They are local by default for a good reason. If you alter the variable outside of the function, it could have unpredictable results. It is best to do it the way Bruce suggests. 'return' is useful for functions in several ways (testing for truth or falsehood is an example). >function test_function($function_var) { $test = $function_var % 9; return ($test); } $var_1 = 18; $answer = test_function($var_1); if ($answer){ echo "$var_1 is not evenly divisible by 9.\n"; } else { echo "$var_1 is evenly divisible by 9\n"; } The function just returns what the variable contains, not the variable itself, you need another variable to 'catch' what it returned. In the case of truth or falsehood, we could avoid having to use a variable to hold the returned value, by doing it directly in the 'if' statement: >if (test_function($var_1)){ echo "$var_1 is not evenly divisible by 9.\n"; } else { echo "$var_1 is evenly divisible by 9\n"; } 'else' is executed if test_function($var_1) returns 0 ('0' or 'null' [the variable never got assigned] are equal to 'false') and 'if' is executed if it returns anything besides '0' or 'null' (true). Notice the variable name used when defining the function: function test_function($function_var) Doesn't have to be the same as the variable used when calling the function: if (test_function($var_1)) The value of $var_1 is 'passed' to the function and the function catches it $function_var and uses it. $function_var is also 'local' to the function and will be null outside of the function. Hope this doesn't confuse you more.
  17. As far as I know "patch -cl -d [phpBB DIRECTORY] -p1 < [PATCH NAME]" is a Linux/Unix command-only and unless you have ssh access to your server, you can't do it (unless you run Linux at home and download your site to there and run the patch). I could be wrong about that, because it has been so long since I did anything in Windows. More than likely, your choice is to apply the patch or upload the files, but there should be a README or INSTALL file in what you downloaded that tells you. Chances are, with the mods you have installed, the patch would fail to work anyway, because it depends on line numbers (sorta) and context, I believe, that won't be the same with the mods added. It is a pain in the behind when you have mods installed to do upgrades, I know, but for security reasons, you really must do it. Some security holes in web apps can actually grant the cracker ('hacker' is used incorrectly most of the time nowadays) access to the server itself, which hosts other sites unless you are on a dedicated server. If something like this happens, your site will get suspended or revoked and you may even face legal issues (seriously....it's called 'negligence'...I'm not trying to be a jerk, just laying it out there)
  18. The closest I have found is this: http://www.phpclasses.org/browse/package/918.html But it requires Hypersnap (or similar) and the permission to execute it through system("blah") If you are a decent PHP hacker, maybe you can figure a workaround?
  19. directly beneath each user's name 'joined', 'From: wherever,wherever" are the buttons: (On/Off) Card PM Click the PM button under his name. PM stands for Private Message.
  20. Try replacing home with home2. I see that from the path to your script: /home2/[username]/public_html/events/template/makepicpages.php
  21. On my Linux box, those two files are found in /usr/share/php/Auth/Container/ from the php-auth package. I do not see the auth module installed on Server44, but I am not a reseller. I have uploaded libs to my server (in my home directory) before to satisfy some issues and just edited the path in the script's config file to point to the directory they are in. I would make a totally separate directory outside of public_html. Edit: MDB.php also happens to be in the pkg php-pear-MDB, which makes more sense in this situation. Try pointing your config file to /usr/local/share/pear or /usr/share/pear These are places I would also try: /usr/lib/pear /usr/local/lib/pear /usr/lib/php/pear /usr/local/lib/php/pear But they are just guesses.
  22. php.exe? I'm a little confused about that. The path should definitely be /usr/bin/php I was not aware that TCH was running any Windows servers. Of course, if it works for you, it works.
  23. I have what may seem like a dumb question: Is there already a file called /home/jdkistm/public_html/stichabrossite/catspjsgigs.txt on your server? If so, that could be the error. The debugging info looks to me like there actually is no error: [error] => 0 And from your code and the permissions you say you have on the upload folder, it should work, unless there already is a file called catspjsgigs.txt in that upload folder.
  24. I know very little about MySQL, but I think your problem lies here: Syntactically, you have to watch your quoting, because the 'interpreter' cannot distinguish between an open quote and an close quote, so all the 'interpreter' sees in your code is this: Try this: >$titleinfo = @mysql_query("SELECT title, year, edition FROM dvd_reviews WHERE id='.$id.'");
  25. I actually created a simple image upload script some time ago using the http file upload functions of PHP. Here it is: ><?php echo "<html><body> <!--- # Copyright (C) 2003 Steve Scrimpshire # email: admin@omarserenity.com # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # http://www.gnu.org/copyleft/gpl.html#SEC1 # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -->" $uploaddir = 'uploads/'; // What is going to be the local file's name? $uploadfile = $uploaddir . basename($_FILES['image']['name']); $picture = $_FILES['image']['name']; // We can't handle files with a space in the name... if ($picture == ""){ echo "You tried to send a file with a space in the name, didn't you?!<br>"; die('Windows user!'); } // We told them PNG format only. See if they listened. if (!ereg('.png$', $picture)){ echo "I said PNG and here you go trying to send $picture!<br>"; die('Bad hacker!'); } // See if they tried to be sneaky and just change the file extension $whatever = $_FILES['image']['type']; $stuff = $_FILES['image']['tmp_name']; $size = getimagesize($stuff); if ($size['mime'] != "image/png") { echo 'You think you can change the extension and fool me?<br>'; die('Stupid hacker!'); } if ($_FILES['image']['type'] != "image/png"){ echo "You expect me to believe that is a PNG???"; die('Really bad hacker!'); } // We required a maximum size... $width = $size[0]; $height = $size[1]; if ($height > 500){ echo "That's $height pixels tall!<br>"; die('What do you expect me to do with an image that huge? It has to be smaller than 500 pixels high!'); } if ($width > 400){ echo "That's $height pixels wide!<br>"; die('What do you expect me to do with an image that huge? It has to be smaller than 400 pixels wide!'); } // They passed all our tests, so let's just upload the thing... echo '<pre>'; if (move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo "</pre></body></html>" ?> And the HTML to post to this: ><html><body> <form enctype="multipart/form-data" action="upload.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="2200000" /> <!-- Name of input element determines name in $_FILES array --> PNG Image to Convert: <input name="image" type="file" /> <input type="submit" value="Send File" /> </form></body></html> Hope this gives you the idea.
×
×
  • Create New...