Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Did you try altering the animation keyframes? Have it not do anything for the first 2-3 seconds, then start changing the opacity.
  2. And I just noticed another one, and on second (third?) look I don't see anything else, so [A-Za-z]{3,16}+ The + makes it possessive, meaning there won't be backtracking if the rest of the pattern doesn't match. It's being used correctly here (backtracking won't ever cause the regex match if it didn't already) but be careful about it using it in general because it can easily cause a regex to fail when it could otherwise match. You could apply it to [A-Za-z]{3,48} as well since it's the same situation. But having it at all is an optimization that isn't going to matter much here so it's not important.
  3. Please note that you're not writing modern HTML: attributes like bgcolor and image width/height have been discouraged for a number of years now. CSS can't respond to events like Javascript can. It has limited support for things like hovering over elements, which isn't so much an event as it is a persistent state, but doesn't really do clicks. Add some simple Javascript that applies or perhaps toggles a CSS class on some element when clicked, then write your CSS around that class.
  4. There is a minor thing I can point out, if you want. /^[A-Za-z]{3,16}+_[A-Za-z]{3,48}$/i Since /i makes it case-insensitive, there's no need to specify both A-Z and a-z. Personally I'd probably list the two and drop the flag: it keeps the expression explicit about what it matches, and while the /i lets you write less, here it's not that much of a difference.
  5. Looks good to me. There are a few online tools to help build and test regular expressions, like if you want to try running a few inputs through the regex to see if they match. regex101.com and regextester.com come to mind. A router takes a request and routes it to a different location or resource or code path. That sounds like what you're doing.
  6. Don't use regular expressions to parse HTML. Use something like DOMDocument to load the markup and navigate to the table cells you want to read.
  7. What are you trying to protect against? Someone reading source code in your repository? Developers themselves knowing how to connect to and read from a production database? Other people on a shared hosting server reading your files?
  8. Email addresses can be validated with filter_var or filter_input. Password "validation" depends on what you want to do but, yes, typically regular expressions are involved. We can give much more precise answers if you can give us much more precise questions. Exactly what do you want it do?
  9. So I guess you figured it out?
  10. My first suggestion would be the same place where you discovered there were multiple processes...
  11. Ideally you would be able to create a "submit" button on the form that is an actual submit button, then give it a form= attribute to point back to the regular form (which would allow the button to behave like a submit button even though it's not actually contained within the <form>). If you can't then add some code when the swal closes (not cancels) that uses Javascript to get and .submit() the form.
  12. Short answer: yes, unfortunately. Because even session cookies still provide tracking ability, even if you're not doing advertising or analytics. It's probably sufficient to include a small dismissable banner that says cookies are required for log in functionality (only) and that logging in implies consent on the user's part.
  13. I suppose it's quite possible you installed it (or some other software) at some point thinking you would need it, however now it turns out you are not. There are bundles like XAMPP that include PostgreSQL instead of MySQL. Maybe that's where yours is coming from.
  14. phpMyAdmin is for MySQL so I don't know what you're doing. If a malicious program wanted a database then it would not use PostgreSQL for it. That means you have it installed for some other reason; multiple "instances" could be simply multiple processes, which is a very normal thing to see.
  15. For that approach, I mean have the submit button not submit the form. Period. Make it be a regular button, not a form submit button. Then, when that button is clicked, you make it Swal.fire. Nothing about the form happens yet. Second step is using the confirm button of the alert to submit the form. Like it was a submit button.
  16. The "first button" would be the one that started submitting the form (and at which point you have it now showing the popup). By the look of it, I'm talking about #submit-btn. Another approach is, if possible, to block submitting the form based on whether the popup is visible: if not then cancel the submit and instead show the popup, and if so then let it run normally. Then make the popup's button also submit the form. That way the first time the form tries to get submitted (via #submit-btn) it will cancel and show the popup, then the second time the popup will be visible and it will continue.
  17. Then in that case, don't submit the form when they click the first button. Make that trigger the popup, then have the popup's button submit the form.
  18. It may be possible to eliminate the resubmit warning too: by redirecting after a form submission to a reasonable page. That could be the same URL or a different one, point is that the page the user sees is from a normal GET request instead of displayed during their original POST request. It's called POST/Redirect/GET.
  19. Do you want to wait a few seconds, literally to give the user time to read? Or do you want to wait for the user to read the popup and click a button?
  20. Theoretically, sure.
  21. Yeah, there's no way 121k files should take 20 minutes unless you have an incredibly slow hard drive. Like, a tape drive might even be faster. I can't help but notice that your error message doesn't match the code: it says you're creating a RDI on I:\System Volume Information while your code clearly says it creates one on M:...
  22. HTML in emails are notoriously - and I cannot stress that enough - inconsistent between clients. My advice is to ignore these sorts of minor differences. That said, I don't see a border-collapse in there...
  23. Confusion about how Promises execute is one of the big reasons why async/await exists: that code would otherwise be written as async function first() { let x = 20, y = 20; if (x == y) { return; } else { throw undefined; } } async function second() { try { await first(); console.log("that's correct"); } catch (_) { console.log("that's not correct"); } } second(); "async" means the function might not finish running immediately and it implicitly returns a Promise, and "await" means to wait around for whatever function call (Promise) to finish before continuing. But you can more or less ignore those keywords and just look at the code like it was two normal functions. To answer the question, 1. p is a Promise that starts with a simple function. 2. You add a "layer" to that Promise which says if it executes normally (resolves) then log "that's correct". This creates a second Promise. 3. You add a "layer" to that Promise which says if anything before it executes abnormally/throws (rejects) then log "that's not correct". This includes problems with the p function but also the .then function you passed - because .catch will catch problems with any of the previous Promise "layers", not just the first or the most recent one. 4. At the end of all this you have a Promise which does not get assigned anywhere, but that's okay because you don't care about the (third) Promise itself - you just wanted it to execute, which it does. If you want to know exactly when each of those steps executes - like literally when it happens - that's a bit of a more complicated subject. The simplest answer would be "as soon as it can", and in the case of your (trivial) example it all happens more or less immediately since none of it needs to try to wait around for anything.
  24. What do you mean by "restarting"? The loop won't actually restart, of course. Are you remembering to truncate the table before every run of this script? If you're getting "too many" files then compare what files you're getting versus what files you expect. The difference would have to be somewhere in there, but without knowing it then you'd have to guess.
  25. Are you sure you want to be following symlinks? Are there any hardlinks on the drive?
×
×
  • 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.