Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Do you really need a form element as an image? Or could you just use a link instead?
  2. Hate to blow my own trumpet, but you could check out this. Basically, you can change display_errors either in your php.ini, at run time with the init_set() function or with a .htaccess file. All methods are explain either on that page or in the comments below. However, if you've got a syntactical error, then you can't change it with the ini_set() function, since PHP cannot interpret your page properly.
  3. I'd say the comment is more confusing than the code. "If show is enabled"? What does that mean?
  4. Hmm, i interpreted it a bit differently. I thought you wanted to have the bottom value of your set as 0, and the top as 100. Ill post what i had in case that was what you were after. The maths is pretty much the same; you have to work out what 1% is 'worth' by dividing the range by 100. You then take the minimum value off of each, then add what 1% is * the value: <?php $array = array('AL' => 5, 'AK'=> 8, 'AZ' => 10); arsort($array); $total = array_sum($array); $percents = array(); foreach($array as $k=> $v){ $percents[$k] = $v/$total*100; } function scale($array){ $max = max($array); $min = min($array); $range = $max - $min; $percent = 100/$range; $scaled = array(); foreach($array as $k=>$v){ $scaled[$k] = ($v-$min)*$percent; } return $scaled; } $scaled = scale($percents); print_r($scaled); ?>
  5. There you are then. You're missing the the closing bracket in your list of fields to insert. Try: $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80')");
  6. Change both of your queries to this: $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error().'<br />Query was:'.$updateSQL);
  7. Just open up the index.php file and do a search for a pound sign replacing it with £ ?
  8. Isn't it some sort of Dreamweaver muck? You'll no doubt need to include some other file.
  9. I guess the odd symbol for the pound sign has something to do with character encoding somewhere along the line. But I can't see anything obviously amiss. You could swap it to the html character code, rather than the symbol though: £
  10. 1.) Did you read the link i provided? What do you mean by an 'external' folder? 2.) Well, that would depend on how your system is to work. If there is one piece of text per image (i.e. a caption) per image then you just want one table. If there are multiple pieces of text for each image (i.e. a commenting system), then you'll want a separate table for your images.
  11. 1.) Start with the manual's description of file uploads. If you're still not sure, you'll find plenty of tutorials if you google. 2.) Store the file name, caption (i assume that's what you meant by text) and a unqiue ID 3.) You'll find plenty of tutorials for thumbnail creating if you google.
  12. GingerRobots query should do it if you fix it by adding "WHERE" before the " Member='$Memberloginname' " Whoops. Good spot.
  13. So you want rankings based on Goals+Points? Try this: $sql = "SELECT *,Goals+Points as score, (SELECT COUNT(*)+1 FROM scoreboard WHERE Goals+Points > score) as rank FROM scoreboard Member='$Memberloginname'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo 'Your rank is: '.$row['rank'];
  14. Yes, i would agree about Boulahrouz. Im pretty sure that's not the same player that's been at Chelsea! I just felt that at, at times, France split open the defence a little too easily. Perhaps you're right about the problems stemming from midfield though. Oh, redbull, it can't be a Spain - Holland final; they're on the same side of the draw. From what's been seen so far, I guess a Portugal vs Spain/Holland final looks pretty likely.
  15. I've managed to watch a few games. Fortunately, i've seen some pretty decent ones too. I watched most of Holland's two games and quite a bit of Portugal's games. I've missed both of Spain's though, which is annoying. Been very impressed with Holland. Absolutely fantastic to watch -- i'd been losing a bit of interest in football just recently, so it's been nice to see some great games. I just wonder wether or not things will be so easy in a much tighter game; the've been amazing going forward, but I think they've been helped by how open the games have been. I also think there are a few question marks over their defence (though Van der Sar looks top-notch at the moment). I was quite disappointed that Henry didn't score last night with his attempted lift over the keeper...it would have been one hell of a goal!
  16. Or maybe you just stick with Barand's solution.
  17. Personally i think your commenting is rather pointless. I can quite clearly see what is happening with your if statement and with your return. IMO comments should be used to explain the purpose of entire scripts/classes/functions and to explain any ambiguities or anything which isn't obvious from the code. Waste of time otherwise.
  18. Oh no, there's no doubt that strtotime() has an overhead associated with it. It's just hugely convenient and generally produces shorter, easier to understand code. However, if you were intending to run this function hundreds of times is your script, then it would be worth using your method as it is quicker. I was quite suprised at how much quicker. And there's nothing wrong with questioning something -- it's the way people learn isn't it?
  19. Or just: function datediff($date1,$date2){ if((strtotime($date1)-strtotime($date2)) %(60*60*24*14) ==0){ return true; }else{ return false; } }
  20. Your description was pretty hard to follow, but it sounds like you need a forward slash after $user: $SaveFileDirectory = "/home/sitename/public_html/$user/";
  21. http://dev.mysql.com/doc/refman/5.0/en/regexp.html
  22. There was(and maybe still is) a firefox extention for rendering webpages as if you were using IE. Again though, it didn't give quite the same results always. I guess anything like this which is emulating the browser wont always produce the exact same results in all cases. I say ditch IE6 support anyway.
  23. It's more than likely you would be better off using some re-writing rules to make it appear that a user has a folder.
  24. So you're just looking to upload flash files with PHP? The manual would be the best place to start.
×
×
  • 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.