Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. But the sites all do different things. You can share a framework but you'll have to write custom code somewhere.
  2. He's trying to obfuscate the URL so people can't steal the music. I've already said (elsewhere) that unless he's willing to venture into client-side programs (Flash, Java, etc) and data encryption he can't win.
  3. This topic has been moved to mod_rewrite. Almost forgot how, it's been so long since I've moved something. http://forums.phpfreaks.com/index.php?topic=362312.0
  4. Only use the path and query string parts of the new URL. No protocol or domain name: if you include them then mod_rewrite will force a redirect rather than just (silently) change which file the request points to.
  5. Fair enough, missed that. So how do the two outputs compare? If you save the non-working image as a .jpg and view it on your computer does that work?
  6. Learn to read print_r() and var_dump() output. object(stdClass)#2 (1) { ... } is an object (of type stdClass which is just a generic class) with 1 variable. ["VerifyAddressResult"] => object(stdClass)#3 (10) { ... } The previous thing (array or object) has a "VerifyAddressResult" member which has a stdClass value. ["ZipCode"] => string(10) "20500-0003" The previous thing (array or object) has a "ZipCode" member which has a string value (with 10 characters) of "20500-0003". So $result->VerifyAddressResult->ZipCode
  7. What does "not work" mean?
  8. Comment out the call to header() and look for error messages. You can also compare the output from the two sites (given the same file).
  9. Generic structures are straightforward but a hassle to use. Why can't you have a dedicated database (database, not server) for each site? It's impractical to make them all use the same data structures when they really don't.
  10. It could be something you can address but first you have to find out what the problem is. If you just want to throw out some random fix and forget about it then that's your decision, not mine.
  11. MySQL is converting the string in the column to a number to match the 1 in your query. Means it ignores leading zeros and stops at the first invalid character (such as a letter). Use quotes so both the '1' and the column are the same data type. SELECT id,activation FROM users WHERE activation = '1'
  12. If it's not on your end then it's somewhere between you and the user, and (unless it has to do with the page slowing down the browser or something) that means there's nothing you can do about it. Meanwhile (a) do you have somebody who manages the server configuration and (b) how many users do you think you have active per, say, minute?
  13. Those files are automatically generated because some application is running, crashing, and is configured so that it will dump memory to a file. 1. Do you have any executable files? Actual programs, not PHP scripts. 2. Figure out what is crashing. Check your access logs for anything returning 5xx errors. 3. Examine the dumps, which is a good idea anyways because you'll need to find out where the problem is.
  14. Wrong quoting style. Apostrophes and quotation marks are for strings only; for object names use backticks.
  15. $car_count = count($car_set); Otherwise having num_rows() as an instance method is decent (if you pass to it the return value from query()).
  16. Is the server receiving enough connections that it has to queue some up?
  17. Yay math. A for loop can do the individual numbers, and the sum is simply 100 * (1 - 1/2^X) Hope I didn't just spoil something.
  18. Also, the correct way for the first example would be to use if(isset(...)) (like how Adam did, but without the ! because the logic is backwards).
  19. Have someone else hold the data for you. Please. There's more to it than just "what encryption algorithm do I use".
  20. Which makes it sound like there isn't any kind of access control on those files. Which is a Bad Thing. You're actually creating a directory for each user? A real, physical directory on disk? Given "http://mysite.com/test/r_dforsxBCDJQTV67.docx", what is the actual URL you want to use? Remember that it has to include enough information that you can find the file, so if the directory is important then you have to include the directory too.
  21. What is /test/r_blah.docx supposed to be rewritten to? What script will it run through, if any? If you're not quite sure what I mean then answer this: what is the current, working URL for that file (which you don't want to use because it's ugly or something)?
  22. upload_script.php can be modified to not show anything and to redirect to someplace (like the upload form or another page) when it's done processing the upload. Would help to see the code.
  23. Depends what the error is, because (a) isset() practically never throws any kinds of errors ever and (b) that code you posted is fine. Besides the alt/title thing. And missing a space between the "an" and the username. And that one branch of the if outputs a block-level element while the other branch outputs text. And HTML injection because cookies come from the user and cannot be trusted. And I'm a bit concerned that you may be using cookies as your only authentication mechanism without validating the username and/or credentials first. Mostly fine.
  24. I do that. I would rather get it right, in basically every sense of the word, than spend my time fighting with something because I don't know how it works. There's a huge risk of doing something which seems correct only to discover hidden problems later. (Which is basically what you've pointed out.) In general I don't write code that I can't stand behind. It's got my name on it: it damn well better be good quality. [edit] I dub this the Showtime Rotisserie programming style. [/edit] I could write a long diatribe about how the code-it-first-fix-it-later programmers really grind my gears but I need to get to sleep and I can't do that if I'm riled up. The short version is that (I feel that) programmers who jump into code without knowing what they're doing are the ones who give PHP a bad name, and I wish they would all burn their computers, burn whatever crappy "certificates" they have in lieu of actual knowledge, recant all the stupid "advice" they've given to unsuspecting saps on the Internet, and never go back to programming ever again. (Disclaimer: the above does not apply to anybody I know here) Oh. And realize that spending more time learning stuff now means less time learning stuff later. Odds are you won't be doing just one little thing now only to never touch it again, right?
  25. All of the ones that have anything to do with "expires". All you'll leave behind is the Headers.
×
×
  • 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.