Jump to content

requinix

Administrators
  • Posts

    15,266
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. I don't suppose you've tried investigating what error is causing the 500?
  2. What errors? What's not working? 7.4 to 8.0 wasn't a huge upgrade but there were a number of breaking changes...
  3. Have you tried asking your professor? Or a classmate? Because if this is related to some class work then it's going to be hard for us to know what it is you're expected to do...
  4. Forums are way better than StackOverflow for anything but the most trivial and straight-forward of questions. Forget trying to discuss anything on SO... Yes: the first one allows one and only one instance of the class, while the second allows anyone to create as many as they want. Which also means the first one's constructor should be private. Public could be okay but that means two paradigms for the class and that's one too many.
  5. sigh There's a lot you'll need to learn if you want to do this - more if you want to learn to do it correctly, and well. Start with just the basics of PHP and HTML: you'll need to write a fair amount of both to make a chat system.
  6. You're wondering how OpenClassrooms is able to work? Easy: Money.
  7. You could, you know, not install two different copies of PHP... XAMPP is a bundle with its own software. That's kinda the point of having it in the first place. Way I figure it, you either keep that bundle and run its PHP (first step: uninstalling the other one) or you keep the system one and switch Apache to run PHP scripts through it instead. I think I'll suggest keeping XAMPP because then you don't have to deal with server configuration. I don't know OSX particularly well but I'm sure you can somehow create a "php" alias pointing to the binary that came with XAMPP. Though you'll probably still have to deal with different CLI and web configurations, but at least that's mostly just copying or symlinking php.ini files.
  8. Is that a complicated way of asking about LIMIT?
  9. But what's to prevent us from having the same "deprecated stuff" problem in a couple years? What could we do to make the tutorial concept actually successful? I'm not just making these questions up: I worked on a site that had the exact same idea, and we even got some people to write a few, but writing them is hard so nobody wanted to keep making more and soon the ones that had been made previously fell out of date. It's a great idea on paper. It's a difficult idea in practice.
  10. What code have you tried so far, what did you expect to see it do, and what did it actually do?
  11. But who will write the tutorials? Who will keep them up to date? Does the internet really need another set of tutorials on a thing? It's a nice idea in theory but rather difficult in the practice...
  12. 1. Instead of doing lots of calculations everywhere, especially the same ones over and over again, use variables. 2. When you just want to echo something, use short open tags. 3. Clean up the code. For example, your "$total_pages" is not actually the total number of pages. And when you're comparing X+1 versus Y+1, having those two +1s is pointless. IMO the basic style you have there, where you have some PHP code in the markup but it's just outputs and simple conditions, is fine - it's simply messy. Like this <?php if ($page+1 < ceil($total_pages / $num_results_on_page)+1): ?><li class="page"><a href="pagination.php?page=<?php echo $page+1 ?>"><?php echo $page+1 ?></a></li><?php endif; ?> isn't as easy to read as this <?php if ($page < $total_pages): ?><li class="page"><a href="pagination.php?page=<?= $nextpage ?>"><?= $nextpage ?></a></li><?php endif; ?> but you can make it look even cleaner by separating the HTML and the PHP even more, like <?php if ($page < $total_pages): ?> <li class="page"><a href="pagination.php?page=<?= $nextpage ?>"><?= $nextpage ?></a></li> <?php endif; ?>
  13. "High traffic" as in being written to frequently? Then you have a small problem of trying to decide what rows in the table you want to archive - after all, a bunch of them are being added all the time. Or, if it's being read from frequently, how are you going to make sure you don't pulls rows out of the table when something wants to read them? I feel like you have some questions here that need to be answered before you can do much more...
  14. Actually you need to do it with SQL. PHP can be used to run that SQL, but PHP isn't going to be creating tables or copying data. If the table is simple and not used frequently then you rename the table and create a new blank one. If it has things like triggers or is being used a lot then create a blank table like the old one, which I think you said you know how to do, then do an INSERT...SELECT query.
  15. How to do what, exactly? Copy the structure and data of a table to a new table?
  16. Unless I'm misunderstanding, right now what you have is, you take the current time and add 3 minutes to know when the form expires, and then later you take that time and add another 3 minutes to it? This: echo $date = date('Y-m-d H:i:s'); echo "<br>"; echo $expire_check['expired']; What was it outputting? Are the two values what you expected them to be?
  17. If you don't understand the nature of the problem then throwing random code at it will not help. Thus: My expert guidance is that you need to learn about (1) arrays and objects in JSON, (2) arrays and objects in PHP, and (3) how you mentally and programmatically translate from one to the other. Here's how you read the JSON: { "rooms_availabilities": [ // do a foreach on $request->rooms_availabilities to get { // ...a set of objects. each object has "id": 570386, // ...a ->id "days": [ // ...and a ->days, which is another array. foreach on it to get { // ...a set of objects. each object has "avail": 5, // ...a ->avail "no_ota": 1 // ...and a ->no_ota
  18. Also, note that "" and "0" are both considered empty().
  19. sigh This is why you don't disable UAC if you don't know what you're doing with your own computer, and why you don't blindly click Yes every time it pops up a message unless you know exactly what is you've asked it to do. My first guess is you downloaded a bad version of XAMPP, or else it was something else you downloaded and ran. Have you tried running the general malware removal tool that Microsoft regularly publishes?
  20. Don't try to handle each image individually. Reserve a number range for your batch of files in a single statement, then use the numbers from that range when you move the files around.
  21. Is that message coming from AVG? Do you trust AVG to be accurately reporting problems that it detects? https://www.google.com/search?q=win32%3Akadrbot
  22. If UUIDs aren't unique enough, then what's so special about the table name to make it so?
  23. Unless you're saying that the endianness in the file varies then all you have to do (for my code) is make sure you use the format codes which specifically say little/big endian. If it does vary in the file, which is possible, then it's probably according to your system, in which case you very likely just use the system-dependent formatters instead.
  24. Take a look at what's happening with the data. Match up the expected values with the actual values... You can keep the C16 but you'll have to piece together the hashes in a different order than 1-16.
×
×
  • 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.