-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
But the sites all do different things. You can share a framework but you'll have to write custom code somewhere.
-
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.
-
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
-
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.
-
Need help extracting just zip code from this data
requinix replied to jbradley04's topic in PHP Coding Help
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 -
What does "not work" mean?
-
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.
-
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.
-
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'
-
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?
-
What are these core.numbers core files in my Wordpress main folder?
requinix replied to pahunrepublic's topic in Applications
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. -
mysql_fetch_assoc(): supplied argument is not a valid MySQL result?
requinix replied to ask9's topic in Third Party Scripts
Wrong quoting style. Apostrophes and quotation marks are for strings only; for object names use backticks. -
Warning: mysql_num_rows() expects parameter 1 to be resource
requinix replied to juliusyves's topic in PHP Coding Help
$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()). -
Is the server receiving enough connections that it has to queue some up?
-
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.
-
More of a theory question on uninitiated variables
requinix replied to Vel's topic in PHP Coding Help
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). -
Have someone else hold the data for you. Please. There's more to it than just "what encryption algorithm do I use".
-
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.
-
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)?
-
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.
-
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.
-
How do you go about adding a small addition to a big system?
requinix replied to cs.punk's topic in Miscellaneous
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? -
Ctrl+F5 hard refresh explanation and solution
requinix replied to jebediah's topic in PHP Coding Help
All of the ones that have anything to do with "expires". All you'll leave behind is the Headers.