Jump to content

requinix

Administrators
  • Posts

    15,089
  • Joined

  • Last visited

  • Days Won

    416

Everything posted by requinix

  1. What do you think? No really: do you think it's single or double?
  2. Don't do emails yourself like this. Use a library like PHPMailer or SwiftMailer. They know how to send emails properly.
  3. Meaning what? Giving us a single sentence of description and dumping a bunch of code doesn't go very far towards persuading us to help with a problem. Including an actual description, like of what you want to do and what you tried and how it seems to be (not) working, does help.
  4. That is also very, very much the more appropriate solution than creating dynamically-named variables. So that's great 👍
  5. First create the /user/index.php (or whatever you want to call it) like ginerjm suggested, then use URL rewriting to take a request that looks like /user/X and rewrite it to /user/index.php?id=X.
  6. The correct solution is to use something set up in the server configuration to let you do URL rewriting - without having to resort to anything to do with 404 pages. Have you tried asking the people who run the server what they can offer you in the form of URL rewriting? It's an extremely common behavior for websites so it's hard to believe they aren't providing you a way to do it.
  7. The first thing to fix is the error page you see when there's a problem. "This page has a problem" is not useful for you to fix anything. What you need are error messages about specific problems. Edit the PHP configuration file, put these two settings at the very bottom of the file, and restart Apache: error_reporting = -1 display_errors = on Then try running your PHP script and query again. I think you'll see at least one warning. Then put your mysqli_report line back, and/or try the query using ' quotes, and see what PHP says.
  8. It would be helpful if you explained what it does do, rather than just what it does not do. Like what kind of error messages you may be getting. And you should be getting error messages because you're using mysqli::execute_query incorrectly. If you aren't seeing messages then fix that before you fix the code.
  9. What you're trying to do doesn't make any sense at all. Perhaps you'll have a better time learning OOP if you aim your efforts in a more sane direction?
  10. 1. Don't use mysqli_multi_query because you're running the three queries by themselves individually already. 2. Don't create queries where you put $_POST values directly into the SQL. It's extremely unsafe. Use prepared statements instead.
  11. Not entirely sure it is possible. What about downgrading the system openssl to 2.x?
  12. Why is this thread still going? <input type="date" onchange="alert(this.valueAsDate.getUTCDate());">
  13. If the value in the cell is a logical true/false then there's no amount of PHP code you can write which will suddenly make it be text. But you can go into the sheet and mark that cell/column as text - that might work. Of course, if the value is true/false and you want "true"/"false" then you could simply handle that. Perhaps with a ternary, like "$variable = $cell ? 'TRUE' : 'FALSE'".
  14. Whose classes? Are there maybe autoload paths that need to be regenerated?
  15. You can't. There will have to be some conditional statement somewhere. OOP is a technique to solve a problem. It is not a solution to a problem. What's the rest of your design, and we can see if OOP is going to help with this particular task.
  16. Okay. But what is the URL, what "slug value" are you seeing, and what do you want to see?
  17. "token name" What is the URL, what "slug value" are you seeing, and what do you want to see?
  18. The template does one name per cell so you can't overlap things on their corners. grid-area is shorthand for grid-row/column-start/end, so you could explicitly set the column-end to be "right". That'll stretch it out over that column, but text won't wrap and I don't know if there is a way to essentially "float" that right element. So what you could do, given you know the size of the columns and rows (or do you?) is to create a floating div inside the content that positions where the overlapping right cell is. https://jsfiddle.net/e1hg05af/
  19. Columns in the correct order isn't an issue, as long as you're careful with the array from the first SELECT - as in overwriting values (eg, the ID to be null) and never removing/adding values (eg, unset the ID and re-create it). It sounds riskier than it is. Worst case, though, fetching in an associative mode will give you the column names so you could do a "normal" INSERT that names the columns. Quoting isn't an issue since you can do a prepared statement, albeit with a variable number of placeholders, and then feed the values array directly into it. Again, worst case you escape all the string things. Anyway, this all feels like a one-off type of job, in which case you might as well just write the code specifically for that table and structure. And besides, this sort of copy operation tends to have nuances that can't be solved in a general-purpose way: are there other fields in the clients table that should not be copied verbatim, and/or are there rows in other tables that should also be copied?
  20. Doesn't have to be complicated: SELECT *, overwrite the ID with null in the returned array, and insert back - without naming columns. You don't know how many columns or what order they come in, but that doesn't matter because the code simply repeats it back to the server.
  21. Why are you using a temporary table to, effectively, copy a single record #37? Why not just do it normally?
  22. Yeah, I forgot: scripts run isolated and don't have things like the window available. Can't really find much searching around, but it looks like the answer is (or at one point, was) to do something with an iframe. As in you make a small page to act as your dialog, run it in an iframe, and somehow display that iframe. A starting point?
  23. Some Googling suggests that there's a weird and long-standing issue with the .phar such that you can't download it from a browser but need to use a tool like curl. PHP itself might work too. > php -r "copy('http://pear.php.net/go-pear.phar', 'go-pear.phar');"
  24. "Refuses to run" meaning what? Error messages? Nothing happens? We aren't sitting at your computer and watching you do things. We can't see what you see so you have to tell us what you see.
  25. "Unable" meaning what? What have you tried and what happened when you did?
×
×
  • 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.