Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Gemini 🤖

Administrators
  • Posts

    15,264
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by Gemini 🤖

  1. It's not using namespaces so there isn't that to worry about... You'd read it like you'd read any other XML file. Like, the first message's body is $xml->sms[0]["body"]
  2. To save me from looking it up myself, how does imapsync use this regex to remap the folders?
  3. If they're just numbers a simple implode() would work (and be better than serializing the array). What are you asking about?
  4. If $compass == "north" then it !="east", right? And if it =="east" then it !="north"... You want &&, not ||.
  5. The problem is with /uploads/test.pptx. Your server is sending the response as a application/zip, which is technically correct (because PPTX files are really just special ZIP files - try renaming one as .zip), but it should be sending the PPTX type. To change that, in a .htaccess somewhere (such as uploads/) add AddType application/whatever-its-supposed-to-be .pptx
  6. Why is the state/country/zip stuff being associated with the person? It belongs with the city information.
  7. Yes: normalize your table. Create a second table dedicated to holding just a person and a city (specifically their IDs). person | city -------+----- A | 11 A | 22 A | 44 A | 34 B | 12 B | 56 B | 78 B | 98 Then you should find everything suddenly becomes a lot easier.
  8. Well that code isn't to blame for it. If you can share, what's the URL you're using for one of these "bad" PPT files? (An example file is fine too.)
  9. Kinda. Mostly I'm saying to start using associative arrays. Your earlier version $universiteiten = array( $uniAmsterdamVan = array('uniNaam' =>'Universiteit van Amsterdam', 'uniID' => 'uva'), $uniAmsterdamVrij = array('uniNaam' =>'Vrije Universiteit Amsterdam', 'uniID' => 'vu'), is not (well, half not) associative. Those extra $uniX variables are just complicating things. You should be accessing everything like $universiteiten[name]["uniNaam" or "uniID" or "hURL"]
  10. That header tells whatever is downloading the file what type of file it is (and thus what should be done with it). If you're going there with your browser and it doesn't know how to handle that content-type then it'll do its default action: download it. From the ten seconds of searching I just did, what you need is to embed the viewer in a page and point the viewer to wherever the pptx comes from. Google's thing then downloads the file and displays it.
  11. 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"];
  12. 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.
  13. Okay. Can you see where the problem is?
  14. Perhaps BASE_URL=/? Because $returnToPage will have a leading slash.
  15. It's working for me. Did you Ctrl+F5 after updating the .htaccess?
  16. $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?
  17. Another option is using something like PHPMailer which takes care of many of the things that tend to get emails flagged as spam.
  18. 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?
  19. 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?
  20. First, I have a question to you: what if there's already a file named with that random number?
  21. 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.
  22. 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.
  23. 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.
  24. 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
×
×
  • 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.