Jump to content

requinix

Administrators
  • Posts

    15,066
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. No, because it varies depending on the different CSS and JS frameworks you're using. If you're using a framework then research what it supports in terms of responsive design. If you aren't, and you don't want to start using one, then learn about CSS media queries so you can write your own responsive rules, and also spend some time understanding your target audience so you know what size screens you should be designing for.
  2. Most of the time a responsive design moves horizontal elements gradually vertical. Right now you have Device Info and Network Settings in a left column and the settings themselves in a right column. The first responsive step towards a narrower design is to use one column and make the labels on the left be headings - which they might already be. Device Info ======================================= ... Network Settings ======================================= Ethernet Settings --------------------------------------- DHCP [ ] IP Address [__________] Subnet Mask [__________] Default Gateway [__________] DNS [__________] Side note #1: you really ought to support multiple DNS servers. You could keep the navigation anchors, which I assume exists, by moving the left column into a slide-out menu. To go narrower, you take the two columns of setting name on the left and setting value on the right and merge them into a single column of setting name then setting value. Device Info =================== ... Network Settings =================== Ethernet Settings ------------------- DHCP [ ] Enabled IP Address [_________________] Subnet Mask [_________________] Default Gateway [_________________] DNS [_________________] Side note #2: many interfaces for DHCP present it as a DHCP vs. manual/static option, not just a mere checkbox.
  3. Which API? If you're having trouble making your PHP code work then you'll have to post (the relevant parts of) your PHP code. Because
  4. First guess is that you didn't install correctly everything you needed to install. Because "no such file" (or directory) means the file doesn't exist, and clearly something expects that file to exist, so it probably needs to exist...
  5. To make sure I understand, you have two options: (a) Do three normal INSERT statements, and get the auto-incremented IDs of what you need (b) Do a normal INSERT and then craft a couple INSERT...SELECT queries based on the raw values you want to insert plus a reference or two to the IDs of the new rows you created that hopefully don't have any duplicates I'm thinking you should go for the simpler option.
  6. That's a browser error, not a PHP error. 271k rows of data on a page is ridiculous. Use pagination.
  7. You can't. Not from PHP. But Safari on any Mac that's been updated in the last couple years will support it. There are client-side options, if you really need to know. Or you could just, you know, not serve WEBPs to Safari.
  8. Seems fine. Check with your browser's developer tools about what the web page response is, and confirm that it's returning that Content-Disposition header. If not then something is getting in the way... And while you're there, see if the tools report any errors or warnings.
  9. Well, the easiest way would be to not render it in the first place...
  10. Yeah. "The targets are the Attribute::TARGET values." Plural. https://www.php.net/manual/en/class.reflectionattribute.php#reflectionattribute.constants.is-instanceof "Retrieve attributes using an instanceof check." Do you know how to "retrieve attributes"?
  11. https://www.php.net/manual/en/class.attribute.php
  12. The targets are the Attribute::TARGET values. https://www.php.net/manual/en/language.attributes.classes.php Since an attribute can be applied to more than one type of thing, getTarget() returns the bitmask of those TARGETs. Then you can use normal bit arithmetic to find out if it applies to a class, or method, or whatever.
  13. All those URLs are working for me.
  14. PHPMailer will also help you send emails that are less likely to be discarded by spam filters. And it doesn't need to rely on the system's emailing configuration. But even then, you can never be totally sure that the email has actually reached its recipient.
  15. The other problems are: 1. Connecting to the database as root and without a password 2. Running 26 separate queries to get row counts for each letter 3. Running the same query multiple times without using a prepared statement 4. The line that calls mysqli_fetch_assoc 5. Using PHP_SELF 6. Trying to navigate from one letter page to another won't work 7. Freeing a result in a variable that doesn't exist 8. Closing a connection in a variable that doesn't exist I assumed that you would fix your current problem, find some of the others, and probably have more questions to ask. Then I would try to help answer them. But if you'd prefer I don't reply to you then I won't do that anymore.
  16. Here's the code you have: $query_result = mysqli_query($query); The "procedural style" mentioned in the docs shows this: mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool You read it like this: 1. This is a function named "mysqli_query" 2. The first parameter is called $mysql - at least in the documentation itself, you can name your variables whatever you want - and it is a mysqli (that's a class) value 3. The second parameter is called $query and is a string value 4. The third parameter is called $result_mode and is an int(eger) value; it has a default value of MYSQLI_STORE_RESULT, which will apply when you do not pass a third argument 5. The function returns a value that is mysqli_result|bool, meaning it will be a mysqli_result (another class) value or a bool(ean) value The Parameters section gives more details about those three parameters. Same for the Return Values section and the return value. There's also an Errors/Exceptions that is useful to understand when and why the function may or may not behave correctly. But back on topic: The first parameter is not optional - there is no default value, so you must provide one yourself. You have done so with your $query variable; remember, your variable can be named whatever you want. But there's a problem: the parameter is supposed to be a mysqli value, and you provided a query string. The second parameter is not optional either, however you are not providing one. That's what PHP is complaining about. If you combine those two facts together, the problem should be pretty clear: you need to call the function with a mysqli and a query string, but you only called it with a query string. I'm guessing this was originally based on mysql (no 'i') code? There is a mysql_query function but it isn't the same as the mysqli_query function.
  17. Before I dig much further, does the state problem happen only if both the users (you and me, in your example) request users 3/4 at the same time, or does it also happen if I request first and then you request within ~5 seconds?
  18. The error message is telling you that the function requires at least two arguments but you only passed one. Perhaps the documentation may be of help? There are other... issues in here, though.
  19. Sounds more like a concurrency problem: you've got two things reading state at the same time, both finding out that the room is available, and both trying to use that room. Operations need to be atomic, meaning the act of checking for an available room and joining the room need to work as one cohesive unit, with state information that can't be unknowingly modified by something else. How are you finding a room to assign to a user? Is it something straightforward like "SELECT available room" and then "UPDATE room SET is not available anymore"? If not that then I don't follow what this "can't tell whether the user is 1 or 2". AJAX polling will start a request, and that request should most definitely be able to identify which user is making it...
  20. Because require() isn't like PHP where you "require" a file and then you get the variables in it. In Javascript, each file is like an independent module, so if you want to share - or export - data from a file then you need to use module.exports as Strider64 showed. What require() will then do, internally, is run the file and then return to you what was exported. If you wanted to export just the one value then you can set module.exports like that. If you had multiple values then you can treat module.exports as an object (which is what it is by default) and set properties on it; this pairs well with destructuring. const arrayOfObjects = [ ... ]; const anotherArrayOfObjects = [ ... ]; module.exports = { arrayOfObjects, anotherArrayOfObjects }; const { arrayOfObjects } = require("./data");
  21. Images are for memes. If you want to show code then please use the Code <> button and paste it into your post. $header1 = "Content-Type text/csv"; $header2 = "Content-Disposition: attachment; filename='" . $csvname . "';"; They're both malformed: the first one is missing a colon, and the second one is using single-quotes when they're supposed to be double-quotes (and it has an extra semicolon that doesn't belong).
  22. Your first goal should be to reproduce the problem - because you can't know what to fix if you don't know what it is, and if you can't reproduce the problem then how will you know if your fix is working? 1. Gather more information. What SSL error? Surely there's some more specific information someone can give you? Like an actual error message, maybe? 2. Apply some logic. Which users are seeing this? What do they have in common? Do they have anything in common at all? Can the users successfully log in at another time? 3. Think about it from a technical standpoint. There are tons of possible SSL errors (see action item 1) but most of them boil down to the server not giving an appropriate cert. Do you have multiple servers? Is there a load balancer? Geographic CDNs? Are you sure they're all configured with identical information and up-to-date certificates? 4. Examine the details. "Certain static content not found" isn't any error message I've ever seen before - assuming it's a literal message. Where is it coming from? Under what conditions will it be emitted?
  23. You're using the htmlentities function when you should not be. 1. You should be using htmlspecialchars instead when outputting something safely to HTML. htmlentities is unnecessary, and if you "need" it to make something look correct then that means you have other character encoding problems that need to be solved. 2. You should only be doing that at the very last moment right when you're doing the output - never before, or else you'll run into problems such as your current issue.
×
×
  • 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.