Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. As before, you're dealing with copies of values, not values themselves. Do away with all those $uniX variables and use array keys. $universiteiten = array( "uniAmsterdamVan" => array('uniNaam' =>'Universiteit van Amsterdam', 'uniID' => 'uva'), "uniAmsterdamVrij" => array('uniNaam' =>'Vrije Universiteit Amsterdam', 'uniID' => 'vu'), echo $universiteiten["uniUtrecht"]["uniURL"];
  2. As long as there is at least one school, $hURL should work. However it'll be the very last one found. But where's $uniUtrecht coming from? I don't see it defined anywhere.
  3. Okay. Can you see where the problem is?
  4. Perhaps BASE_URL=/? Because $returnToPage will have a leading slash.
  5. It's working for me. Did you Ctrl+F5 after updating the .htaccess?
  6. $universiteit is actually a copy, not the original. When you add the hURL you're only adding it to the copy. You could use references but they can backfire if you don't know exactly how it all works. So use the array's keys and update $universiteiten: foreach( $universiteiten as $universiteitkey => $universiteit ) { $universiteiten[$universiteitkey]['uniURL'] = $hURL; echo 'Hodex URL: ' . $hURL . ' '; // why bother with the array when you have the value?
  7. Another option is using something like PHPMailer which takes care of many of the things that tend to get emails flagged as spam.
  8. Eww, GoDaddy. Throw a FileETag All in your .htaccess and see if that changes anything. If not, is there a URL you can share so we can see it for ourselves?
  9. The image itself is being cached, not the webpage displaying it. Your server should be set up to send correct caching headers with images. Normally they are by default but apparently not yours. What web server are you using?
  10. First, I have a question to you: what if there's already a file named with that random number?
  11. Is it consistently X/5? Hint: it's consistently X/5. define("AMOUNT_PER_STAR", 5); define("MAX_AMOUNT_FOR_STARS", 400); // you said 600, but $80*5=400 define("MIN_AMOUNT_FOR_STARS", 15); if ($user["amount"] >= MIN_AMOUNT_FOR_STARS) { $amount = min($user["amount"], MAX_AMOUNT_FOR_STARS); $user["max_stars"] = floor($amount / AMOUNT_PER_STAR); } Normally I don't litter my code with lots of constants but for some reason I felt like it this time.
  12. You didn't do anything wrong. The thing with joining a table against itself is that you'll come across the same row twice: once on the left side of the JOIN, once on the right side. It's like multiplying: you can get to 15 by multiplying 3*5, but 5*3 does it too. Put in a condition that compares the two teams in such a way that only one combination is valid. For instance, only where the left team's ID is less than the right team's ID. Unless there's something in particular you'd like to see (eg, alphabetical, or the home team must be on the left, or the loser on the right) the actual condition itself doesn't matter.
  13. Yes. And I'm having a hard time coming up with situations where that question, even out of context, would get a different answer. Srsly. Chaining hashes is like multiplying by 0.999. Doing it once or twice leaves you with something comparable to the original, but the more you do it the weaker your result will be.
  14. requinix

    UTF8

    Do you need "transparent character encoding filter for the incoming HTTP queries, [to perform] detection and conversion of the input encoding to the internal character encoding"? The manual
  15. If the choice is between "good" and "bad" then only one of those answers was the "good" answer. That wasn't to say it wasn't correct or right, but as far as I'm concerned it wasn't good. But now I'm just splitting hairs.
  16. Your answer is right, it's the best way to build a string like that without having a trailing comma that needs to be removed. I'm just saying that using something like json_encode(), which is for situations exactly like this one, is better.
  17. I have a question for you. If you also believe that it should be done another way, and I'm sure you've seen that OP is trying to learn that better way, why did you give him/her the bad answer?
  18. Construct a multidimensional array that looks like what you want, then json_encode it.
  19. ... The idea you have of creating files for every single thing is bad. Very bad. Don't do it. There is absolutely no reason whatsoever that anyone should ever need to do it. Do you want to know how you should be doing it?
  20. You can't write to the middle of a file without overwriting whatever came after. You'd "have" to read in the whole file, make your change to the string in memory, then write it out.
  21. requinix

    UTF8

    Multibyte Support enabled There's your answer.
  22. requinix

    UTF8

    Is the extension not enabled already? It's one of the most common extensions and thus often is.
  23. I'll say it now: there could be an extension that'll help do this. Such as mod_macro. Yes, there is some flexibility with configuration, but I'm not sure it extends all the way to directives like ServerName and DocumentRoot.
  24. Here's one, and here's another.
  25. From the first file that was executed (generally). Subtle difference. Moral is to always use absolute paths whenever possible, either with the DOCUMENT_ROOT or the __FILE/DIR__ constants. require_once($_SERVER["DOCUMENT_ROOT"] . "/configure.php");
×
×
  • 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.