Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Script IDs never matter. Why do you want to change it?
  2. What? Sure you do: that second server you were planning to use. The one where the domains redirect to, and where you were going to redirect from. Take that, add a virtualhost for a catch-all domain (so any domain that doesn't match some other known site), then give it a redirect to go to destinationtarget.com/(requested domain). It's one configuration that handles the redirects for every single domain you throw at it - assuming you all want them to use the same pattern for the redirect. Then you change the DNS for the domains you want to redirect from such that they resolve to that second server. Browser will look up "domain1.com" or "domain2.com" or "domain3.com", all of them resolve to that second server, browser asks the server for the webpage at that domain, server responds with a redirect to destinationtarget.com. In fact, that "second server" can simply be whatever server hosts destinationtarget.com. I mean, this redirect business is very lightweight. It's not going to add any noticeable load to anything. So there. You have a server that hosts destinationtarget.com. Give it a new configuration for a catch-all domain that does the redirect I said, then update the domains to point to that server. And if you decide to handle some redirected domains differently then you don't have to update DNS for anything.
  3. Isn't that more complicated than it needs to be? Point each domain's DNS to some web server you control and have it issue the redirects. One place for everything.
  4. WordPress isn't what we in the software development industry would call "good" or "well-designed", but at the very least it should be capable of dealing with custom database tables. Worst case you can use another for loop: it's fast and easy, even if inefficient. Any additional amount of time you want to invest in this is up to you.
  5. If you didn't need an actual number then this is pretty easy: if name_of_deceased_2 has a value then you have at least two people, else if name_of_deceased_1 has a value then you have one person, else there is nobody in the grave. Assuming you fill those fields in order. The simplest way to get a count would be to do another for loop, except this one counts when the name_of_deceased_N field is filled instead of outputting something. A bit wasteful, having to get those fields multiple times. The clean way is to get all those fields into one array variable, such as one that looks like array( array( "name_of_deceased" => name, "burial_date" => date, "clergy_name" => name ), ... ) One for loop to get all the data into a better format than you have now, adding people to the list if the name is set, then you can get the count() of people easily and foreach on it to display. The ideal way is to not need to have 15 fields to cover 5 people in a grave. Are there ever graves with more than five people? What will you do then - add more fields? Having to add them like that every time is a sign of bad database design. What should be set up is a single table that has four fields: a grave identifier, the person's name, the burial date, and the clergyman's name. Then you get all burials for the grave, there's no limit on how many you can cover, and getting counts is easy.
  6. What's the question, exactly? How to get the number of people buried so that you can decide whether to say "person" or "people"? At what point in the code do you need this? Will it come before or after that "who's buried" stuff you posted?
  7. But why redirect and then redirect again? Why not just have domain1.com redirect to the place you want instead of some other place you don't want?
  8. Doesn't have to be. You can tell it to redirect however and wherever you want.
  9. Not me, no. If you insist that you can't do it yourself then we have a place you can post your job offer, but frankly, if the problem is that your knowledge is "far too limited" then this would be a really good chance to try to do something about that.
  10. My first reaction would be "don't use syslog for regular logging". It's fine for important things, but miscellaneous info and error messages can get lost in the sea of other activity.
  11. One step at a time. 1. Update the code so that you can place a marker at some coordinates. Don't bother trying to geolocate anything. Just hardcode some numbers in there. Make sure it can be placed sometime after the map has been already fully initialized and drawn. 2. Update the code so that you can move that marker to some new coordinates. Again, no geolocation, just hardcode another set of numbers. Start by putting the marker at the first location like before, then use setTimeout have the marker reposition somewhere else 30 seconds later. 3. Update the code so that you can get past the geolocation permission prompt to get the first position. Then use that first position to place the marker at its first location for real. 4. Update the code so that you can "watch" for geolocation changes. Just console.log or alert the new coordinates so you can see it working. 5. Update the code so that the geolocation changes will reposition the marker. IIRC you don't have to do any "get the location every 30 seconds" work because the browser can simply tell you when the position changes.
  12. What is the value of $first and $second?
  13. Do you only need a hint in the right direction? You can get the first day of week #1 by asking strtotime for "January 2 last Monday". That works because a) If January 2 is on a Monday then "last Monday" will go back a week - which is what you want because Jan 1 would be Sunday and thus part of the previous week b) If January 2 is on Tuesday-Sunday (note that span is all within the same week) then "last Monday" will go to the previous Monday - which is going to be the same week that January 1 is because it is sometime between Monday-Saturday
  14. That's not true, no. But your entire site should be over HTTPS anyway, so...
  15. Like the kind you used to access this forum? A form that asks for a username/email and password? You know, the normal thing that you see on the internet.
  16. Yeah, you definitely still need to use escapeshellarg. Escaping values isn't always about malicious data - sometimes it's simply about making sure that stuff doesn't get screwed up. But serialize? Ew. I'd rather have the other process read JSON through stdin.
  17. Not in this forum. The PHP Coding Help forum supports it as a sort of trial run-type thing, but we've had that running for so long we might as well apply it to the other forums too...
  18. Browsers will remember Basic authentication credentials and pass them along any time they think the website might want to have them. The session is essentially pointless. The "only" way to log out a user is to re-send a new 401 response so the browser will prompt for (new) credentials. An even better answer would be to forget Basic auth and set up a normal login system like every other website does instead.
  19. It gives more control, but one feature it doesn't have is a way to wait for the process to close or a timeout to expire. So unless I missed something, that means having to poll the process every couple seconds to see if it's still going, then giving up and terminating it if the 120s has passed.
  20. 1. Live Server? Didn't you say you were using XAMPP? 2. Unless configured otherwise, .html extensions do not run PHP code. Use a .php extension.
  21. It has nothing to do with the IDE. Okay, AJAX, then:
  22. Note that PHP 8 changed string <=> number comparisons.
  23. It wouldn't have to be a second script. All you'd have to do is edit the main script right near the beginning so that it forks, does a timed (120s) wait while the child runs, then if the time expires it sends a term signal to the child. But don't bother. Use timeout(1) for the problematic command.
  24. "Could not authenticate" could mean a variety of things. Start by checking the username and password you need to use for you mail server.
×
×
  • 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.