Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. 1. Then you aren't using the right directives. It's true that browser's don't have to obey the settings, but when done correctly they will obey the headers when they are supposed to. 2. If each image in the list corresponds to one unique image then you do want the images cached. What you don't want is the HTML producing the random image to be cached. Which is entirely different than what you're going at. And it shouldn't even happen in the first place with PHP scripts. Which leads me to 3. Have you confirmed that there is an actual problem here? Or do you think/assume there is a caching problem and you're trying to fix it preemptively?
  2. It's could be... Look at the traffic in detail to tell what they're doing. But blacklisting an entire IP range should be (1) a last resort (2) after you've determined there's no other way (3) to prevent people from causing problems with your system.
  3. You're trying to fix the symptom. Fix the actual problem: your server is telling browsers to cache the images. Is this all online somewhere we can see?
  4. counter = 1 for each image { if counter = 1 { output div code with inline-block } else { output plain div code } output image code output closing div counter++ }
  5. Why stop it? Is there a problem? Traffic from Amazon (AWS) could be VPN servers or proxies that people need to use.
  6. Using just vanilla Javascript? It's passed to the function as the first argument. element.addEventListener("change", function(e) { e.preventDefault(); // ... });Unless you want to be cross-browser compatible, in which case don't use vanilla Javascript.
  7. You can do SHOW CREATE for pretty much anything in the database. Like SHOW CREATE FUNCTION whateverfunction. It'll return a string with SQL. To dump the database I assume you're using mysqldump? Try its -R/--routines option.
  8. To answer the original question, use event.preventDefault().
  9. Go to the kitchen, make yourself a sandwich, eat the sandwich, then come back and read your code very carefully. if atts has the property then { tell me that the property was removed } else { tell me that the property was not removed }Protip: delete has a return value for whether it deleted the value.
  10. .extend() is basically a .append() that works with arrays. Assuming you're using $to_checksum as a string instead of an array, $to_checksum = "\x68\x32\x01\x7b\x01"; // to_checksum.extend(struct.pack("<h", gif_len)) // < = little-endian, h = signed short (2 bytes) // php's pack() doesn't have a little-endian signed short code, so convert signed to unsigned and use 'v' $to_checksum .= pack("v", ($gif_len < 0 ? 65536 + $gif_len ? $gif_len)); $to_checksum .= chr(packet_num) . chr(last_packet_num);I'm a bit unsure of that last line.
  11. Make sure your file is named *.php, that you are using full <?php tags (and not just ), and that you have PHP installed properly.
  12. Basically, a class should represent a noun. It is responsible for a particular thing. Inside the class are methods and those represent verbs. Those methods perform actions. $noun = new Noun(); $noun->verb(); Registering and logging in are verbs. Ask yourself "what is doing the registering and what is doing the logging in?" The answer is a user. (Which is a noun.) So there should be a user class with methods to register and to log in. Two answers:1. Now you're thinking about models. A model is a class, which means it's a noun. 2. Does it make sense to "create" a registration? "Create" a login? Not really. Registration is the act of creating a new user. So there should be a class for the user model which has CRUD operations. Logging in doesn't really impact the model... unless you wanted to record login time or last activity, then that would have an impact of updating the user record. But otherwise you're looking up information, which is part of CRUD. Depends. Most of the time a database class represents a database connection (a noun), and has methods to help you do stuff so that you don't have to do everything manually via PDO. Such asa) Abstracting the database connector away (which PDO kinda does already) b) Retrieving database credentials so the rest of your code doesn't need to know c) Helper methods to make some operations easier, like executing a SELECT and returning the results in an array Well, what kinds of things does a user do? We've already covered "a user can register" and "a user can log in". "Single" is about making sure a class isn't responsible for multiple things that don't make sense to combine. Like a class that does database operations as well as handle file uploads. If you can say "this class is responsible for " then you're probably okay. I could argue in favor of doing that, but practically speaking 1. There aren't too many operations involved with passwords: create new random password, create hash of password, verify password 2. Often those operations are part of a larger operation: create a new random password because the user forgot theirs, or create a hash of a password because the user is changing theirs, or verify a password because a user is trying to log in 3. There's not much code involved 3. Pretty much everything you do with a password has to do with a user, for which you already (hypothetically) have a class, so you might as well put the password code in there
  13. The "string" type will be coerced to the "String" type, which does have methods and properties.
  14. Don't let Jacques bother you. He's like that to everyone. One way or another, what you're trying to do can be possible. How much of this code is yours? Or put another way, how familiar are you with the PHP involved in this process and are you able to edit it?
  15. The URL is only the path portion. You probably don't need to concern yourself with the domain, so really all you need is to match the index.php and add a condition for the query string. <rule> <match url="^index\.php$" /> <conditions logicalGrouping="MatchAll"> <add input="{QUERY_STRING}" matchType="Pattern" pattern="^aggrement$" /> </conditions> <action type="Rewrite" url="index.php/aggrement" appendQueryString="false" /> </rule>I think. That does a rewrite - the user doesn't get redirected. If you want a redirection then use a "Redirect"-type action. Reference
  16. I know. I was anticipating a "what is domdocument" reply.
  17. What does your web.config look like?
  18. 1. Look at the syntax highlighting near the beginning of the code. See how the echos are black but the exit is green? Something changed in between them... 2. Those echos aren't using correct syntax for strings. Read this to learn what kind of syntaxes are allowed.
  19. if( $_GET['stepaa'] || $_GET['stepab']|| $_GET['stepac'] ) { echo "$_GET['stepaa']"; echo "$_GET['stepab']"; echo $_GET['stepac']"; exit(); } ?> Drop Down Draw Draw outline for Enhance Make Drop Down an Oval Ovals a circle circles arms hands feet foot lower face belt ears ear eyes eye brows nose lips retinas shoes boot wings wing beak tail body hairs waist leg hip fingers horn horns weapon book table crown ribbin locket bangles head mouth tongue necessary improvements to finish , . & Drop Down an Oval Ovals a circle circles arms hands feet foot lower face belt ears ear eyes eye brows nose lips retinas shoes boot wings wing beak tail body hairs waist leg hip fingers horn horns weapon book table crown ribbin locket bangles head mouth tongue necessary improvements to finish. Next time, please post short code like yours directly into the post. Many people don't like having to download attachments.
  20. Load the HTML into DOMDocument, use getElementsByTagName to get all the H2s and loop over them, and for each one set the "id" attribute to whichever value you want according to its textContent. DOMDocument
  21. pv can only act like cat, and you can't use that to copy a directory structure either. How about doing a cp -v to see each file being copied? Or maybe... uh, tar c to stdout, piped to pv, piped to tar x from stdin? But doing this might even slow down the copy. As for rsync, -v and/or --progress should work. No pv.
  22. The REQUEST_URI includes the query string too. $page_url_rewrite will be either "test" or "?p=test". Dump out $_SERVER and look for a more appropriate value to use...
  23. I take it you're not talking about the Find Content button in a user's profile?
  24. What does phpinfo() say about whether the soap extension is loaded?
×
×
  • 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.