Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. I got a new laptop a couple weeks ago. Dell XPS M1530 Intel Core 2 Duo T8300 2.4GHz 4GBs 667 RAM NVIDIA 8600M GT (256MBs) I'm running a dual boot setup - Vista Home (i prefer it to XP, but meh) and Ubuntu 8.04. Actually, it's technically a triple boot, since dell include this 'media direct' pile of poo. Basically a button on the laptop that launches a media player without loading your main OS. Turns out it's a cut down version of XP. Unfortunately, it can't read any of my media since it's all stuck on an ext3 partition (read in vista with fs-driver). The media player is truly awful though, so I don't care.
  2. Thanks daniel. Interesting reading. Thank god the firefox % is higher than other averages.
  3. Well, there isn't an error in the code i provided, so i can only assume it's generated elsewhere in the code. However, what i gave there was more of an example of the way you should be doing it. It wouldn't work with your current database structure. As for understanding the error, this might help you.
  4. Lol... have you tried pointing your IE6 to phpfreaks.com? Lol, good point. Unfortunately, i have. Damn school computers. Fortunately I wont ever have to go back there, but i'd be surprised if they upgrade to IE 7 anytime soon. I think it would be reasonable to assume that 30% of phpfreaks' user base wouldn't be on IE6. I can't imagine too many people writing php but still using IE6. Do we keep any browser statistics?
  5. What do you think? Here's what you've been told: 1.) You shouldn't store numbers with commas in your database 2.) You can strip out the commas with str_replace(). Now, can you think when you might want to strip out the commas?
  6. You can: $foo = 100; $bar = $foo/2; echo $bar; //echos 50
  7. Try: $data = str_replace(',','',$_POST['data']);
  8. You'll need some AJAX. There was actually a tutorial for an auto-suggest on ajaxfreaks, but that's been down a while im afraid. However, if you google, im sure you'll find some examples.
  9. Is $price 2? Seriously though, we need a bit more information.
  10. 'remote html directories' You can't traverse a remote directory. It'd be a bit of a security flaw, don't you think?
  11. Erm, well i actually showed you what to change too.
  12. The problem is that your script relies on register_globals being turned on(see here for a description of register_globals), which isn't a good thing. This setting was turned off by default in PHP 5. You'll need to extract the variables from their relevant superglobal array. Change execute_commands and the call to the function (at the bottom of the script) to: function execute_commands($file_index, $cmd, $mycall, $callsign) { if ($cmd == "search") { search_log($file_index, $mycall, $callsign); } else { show_entry_form($file_index, $mycall); } } // Start Commands // Name of the Log File $file_index="logsearch.php"; // Execute commands execute_commands($file_index,$_GET['cmd'],$_POST['mycall'],$_POST['callsign']);
  13. You'll also have to click on the wamp icon in your system tray and click 'put online'.
  14. Here's some criticism: show people what they're criticising before you ask them to do so.
  15. How can you possibly say it's unnecessary to cater for IE6 users. Irritating though it is, most statistics place IE6 usage at about 30%. I dont know about you, but i'd say 30% of people is quite a large chunk of people to ignore.
  16. The simple answer for me to give is that your data appears to be rather hopelessly stored. If you're really having to go to the lengths of the above to generate a list of people in a club, then you've got issues with your database structure. Normally, the way you'd do the above is with three tables: Table: clubs Fields: clubid, clubname Table: clubparticipants Fields: clubid, userid Table: users Fields: userid, firstname, lastname etc Edit: Note that for other thing such as your Squadrons, you'd need two further tables: squadrons and squadronaparticipants and their structure would be similar to clubs an clubpartipants You would then be able to select everything from your clubparticipants table, and use the clubid and userid to grab the club name and person's name from the clubs and users table respectively. You can then order by clubid, and only show this when it changes. Something like this: <?php $sql = "SELECT p.clubid,p.userid,c.clubname,u.firstname,u.lastname FROM clubparticipants as p, clubs as c, users as u WHERE u.userid=p.userid AND c.clubid=p.clubid ORDER BY p.clubid"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); $prevclubid = ''; while($row = mysql_fetch_assoc($result)){ $clubid = $row['clubid']; if($clubid != $prevclubid){//the club has changed echo $row['clubname'].'<br />'; $prevclubid = $clubid; } echo $row['firstname'].' '.$row['lastname'].'<br />'; } ?> The above is far cleaner and much easier to maintain than your current code. To take one example, what happens with your current code if another club is created? You'll have to modify your code, rather than just adding to the database. Not good. All that said, if you're just looking for a quick and easy solution then there are at least some differences between the code you're adapting from and what you have currently. For example, these lines: WHILE ($squadders = mysql_fetch_assoc($result)) { $tempSquad = explode("^", $squadders["squadronDB"]); Should be: WHILE ($squadder = mysql_fetch_assoc($result)) { $tempSquad = explode("^", $squadder["squadronDB"]); Note that there is no 's' on $squadder, just as there is no 's' on $clubber in those lines you're adapting from. I wouldn't guarantee that changing that will fix your problem (though it could be argued that your problem would not really be fixed until you changed your database structure), since i've not followed your code through and I don't know your database structure/
  17. Hmm, your code looks a little confused. Perhaps if you explain what you're actually trying to achieve, we might be able to provide a neat solution. It looks to me like you just need an extra condition to your WHERE clause, rather than cycling through the results and checking against an array. But as I say, it's a bit difficult to tell without knowing what you're trying to do.
  18. You'll need AJAX to do that. If you google, you'll find plenty of tutorials. See if you can avoid unnecesary punctuation next time.
  19. I've not counted, but i'm fairly confident that there's not 41 lines in the code you posted. Any chance of pointing us to the correct one?
  20. If you want to UNION your queries, you'll need to have each query return a count (which is more efficient anyway): $sql = "(SELECT COUNT(*) FROM messages WHERE message_to='".$_SESSION['SESS_USERNAME']."') UNION ALL (SELECT COUNT(*) FROM attack_log WHERE message_to='".$_SESSION['SESS_USERNAME']."')" $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); $count1 = mysql_result($result,0); $count2 = mysql_result($result,1); if($count1 == 0 && $count2 == 0){ //no rows in either }else{ //rows in one or the other } Of course, i would question your database structure if you have two tables with the same fields in them...
  21. The user must provide the session ID. There is no way for the server to track the user. Normally, the session ID is set in a cookie. If you're really against this, you can set PHP to pass the ID around in the URL or in hidden fields. This is not without its own set of problems, however.
  22. Personally, i don't really see this thing taking off. I'd rather spend an evening down the pub than on some virtual world im afraid. For the foreseeable, 3D virtual worlds are just games.
  23. Note that PNG transparency is unsupported in IE6 and that some browsers support the colour correction on PNGs, preventing them from matching up with CSS colours.
  24. Wouldn't it be much simpler (for both you and for the user) to add a multiple parameter? http://www.w3schools.com/TAGS/tag_select.asp
×
×
  • 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.