Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Not really. Been many years since I've needed those kinds of docs. But the /docs/ stuff looks useless - the FAQ probably has everything you need. XAMPP comes with just about everything. Install it, maybe configure PHP for special extensions you need or whatever, then put your files wherever it is you're supposed to put your files ("Where should I place my web content?"). If you're on Windows, WAMP (er, I guess it's "WampServer" now) is also popular, and it may be easier to work with.
  2. XAMPP is fine, sure. The point is that you're complaining about the hassle of having to upload files to some server somewhere every time you want to make a change. Well, you know what the easiest way to see changes is? If you don't have to move the files anywhere. Don't bring the files to the server. Bring the server to the files.
  3. Hold on. What?
  4. Have you really gotten this far and not set up a local development server for yourself?
  5. Is "gone" nullable? Meaning what, exactly?
  6. array_shift($crawling); foreach($crawling as $site) { followLinks($site); } That part doesn't make sense. I get what you're trying to do, but the code doesn't match. You're using recursion which has three parts to it: 1. Start off with some value 2. Process one or more next values based on the current one 3. Stop at some point Per #1 you start off with a URL that is not in $crawling. By the time the first loop finishes, you have built up a list of URLs per #2. However you shift off something from $crawling - you intend for it to be the initial URL but it isn't in there. Additionally, when the second function call goes through its first loop, it's going to remove the first value from $crawling, however there's no guarantee that your current URL was the first one. What if the first function was on its second value in $crawling when it called itself? Basically every time you use a function like array_shift there should be a corresponding array_unshift (or $array[] = of course), and there isn't one for the initial URL. That miss leads into other design problems, and you're basically mixing a recursive crawler (function calls itself) with a non-recursive crawler (your use of $crawling). So before I go on, do you want to try the recursive approach (get URLs, get links, call function for each one) or the non-recursive queue (use an array to track URLs, read the next page from one end, add new pages to the other end) approach? Also, this is not object-oriented. Do you want to go that way or stick with the single function for now? Either way we're going to be getting rid of those global statements.
  7. That's a really, really, really vague question. You're going to have to be a lot more precise about what this class is and what you're supposed to do with it.
  8. Without looking too closely I'm pretty sure there's significant room for improvement. But don't do that yet. If you get a 500 error then that means the script is crashing. You need to fix that. Check your server and/or PHP error logs for information about what went wrong.
  9. You cannot have the download go from the remote server through your main server. The problem is people having to get the file from your server, and if you proxy it from the other server through the main server it will look just the same - except be more expensive for you. You need a download script on the other server as well. If you can't do that, give the user a direct URL to the file.
  10. Thing is, the code you've shown does some database stuff. That's not the place where the download happens, nor the place where the user clicks a link to get the download.
  11. Have you looked into why? Are the geographically closer to England than the main site's servers? Because what you may be discovering is the concept of mirrors.
  12. A lot of my opinions should probably have the disclaimer "In theory, ...".
  13. Test it locally. You do have it available and set up to test locally, right?
  14. Sounds like a homework assignment. What have you tried so far and what happened when you tried it?
  15. 18 is not a question. It's simply a demonstration of how to use a table.
  16. I'll repeat it: 1. Those two RewriteConds are only applying to the first RewriteRule. 2. Better than repeating those two RewriteConds six times, you should have all !-f !-d URLs go through function.php. Then it looks at the URL and determines which func/lang+func/lang+func+sub/whatever to use, like how the .htaccess is trying to do now. 3. You do not have any RewriteRules that will apply to /. That means Apache will use your index.html. AJAX is not authentication, you need all of this stuff for everything.
  17. You still need to tell the AJAX what URL to send the data to. Don't do any redirects. Change the "url" to be whatever page it is you want to reuse.
  18. Whatever code is in my_code.php has to be moved into the current file. Obviously. What happens after that depends on what the rest of the code looks like. If the file doesn't process POST data for anything else then you can use standard practices for handling form inputs (such as by checking if the REQUEST_METHOD is POST) and you don't have to change the AJAX any further.
  19. Boosting is a bannable offense. https://support-leagueoflegends.riotgames.com/hc/en-us/articles/201751834-MMR-Elo-Boosting
  20. If the two apps are different in the very nature of what they do then they should be separate. If the two apps are the same in nature but different in content then it will be better to use one database and have it distinguish between what content is available for what subdomain.
  21. If you want to allow trailing slashes in your URLs then keep one and make the slash optional. But that still doesn't cover the root / URL. Also I missed that your first Rule only applies when the path does not exist as a file or directory. And index.html exists. Because: RewriteCond only applies to the single next RewriteRule. Rather than repeat those every single time, most applications do it a smarter way: route all requests through your PHP script and have it look at the URL and decide what to do.
  22. Because none of your URL rewriting rules apply to / $_POST will work as long as you do not use the [R] flag or cause a redirect by some other means. $_GET will work as long as you do use the [QSA] flag.
  23. Please don't hijack other people's threads for your own questions. How does it add the script to the head, and why does it need to know who inserted it?
  24. Creating the regex is fairly straightforward: start with the literal string you want to find, escape any special characters that you don't want to be special (like the [ ]s), then substitute in stuff like (\d+) where you want to find numbers. The replacement string works much the same way, and you can reference the matched numbers from before using $1 or \1 (careful of the backslash). Honestly, you're probably overestimating how difficult this will be.
  25. REST would suggest /documents/123/file(s).
×
×
  • 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.