Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. The referrer is insecure. Don't rely on it. Do you mind having the file go through your server first? Means double the bandwidth (both site1 and site2 are sending the whole file) but it's the easiest answer.
  2. Start with any number of non-space characters, then repeat a set of one space followed by more non-spaces. Problem is that it's harder to do the 2-12 requirement. /^[a-z0-9]+( [a-z0-9]+)*$/i For the length just do x.length>=2 and x.length
  3. Stop creating thread after thread after thread for the exact same problem! It's annoying!
  4. If it's a client-side thing then this could be done in JavaScript...
  5. Right, multidimensional. You were actually already doing that but I guess you didn't quite realize it. Anyway, use to get the syntax highlighting.
  6. if the cookie is empty and hide is 1 or 2 { set the cookie to 1 } else if hide is 2 { set the cookie to 1,2 } else { anything that needs to happen here? }
  7. By putting in logic that does one thing if it's 1 and another thing if it's 2?
  8. The .+ will match everything after the ".Sent Items." (the subfolders). Parentheses make it a capturing group so that the substitution text can use $1 (1=first group counting left-to-right) to insert it back in.
  9. The message means that $firstfs (where strpos() is to begin looking for a period) is negative* or beyond the end of the string**. We need to see more code. Especially the stuff that creates $firstfs and what's in between that code and the line you posted. My guess is that $block1 is has one period at the very end and that the $firstfs code looks like $firstfs = strpos($block1, ".") + 1; While we're at it, how about some context? What does the code do? What is $block1? * Maybe. Might have different message for that case. ** Technically, greater than or equal to.
  10. Not without knowing what the problem is. Can you at least describe it?
  11. At this point I'm not going to flat-out give you the answer. I've been trying to get you to keep working on it, and unless somebody else comes in here and posts the right expression you'll have to try to follow along with what's happening. If you know a bit of regex then you know what [abc] means, right? If I gave you a string cat and told you to replace [abc] with 5, you'd end up with 55t. The t didn't change because it wasn't part of the expression. Now, you want to change INBOX\.Sent Items to INBOX\.Sent, right? Still the same subfolder structure, right? So for the substituting you don't have to care what comes after that one part - if it's not in the expression then it will remain unchanged.
  12. That MIME type is for DOCX files. Find a different one.
  13. Keep the first one but with a change. Speaking of, the $ means end-of-string so do you really want it?
  14. Oh, it's Perl-style. I didn't realize (though the s/ really should have tipped me off). Anyway the /i goes at the end. As in s/.../.../i.
  15. 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"]
  16. To save me from looking it up myself, how does imapsync use this regex to remap the folders?
  17. If they're just numbers a simple implode() would work (and be better than serializing the array). What are you asking about?
  18. If $compass == "north" then it !="east", right? And if it =="east" then it !="north"... You want &&, not ||.
  19. 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
  20. Why is the state/country/zip stuff being associated with the person? It belongs with the city information.
  21. 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.
  22. 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.)
  23. 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"]
  24. 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.
×
×
  • 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.