Jump to content

chhorn

Members
  • Content Count

    74
  • Joined

  • Last visited

  • Days Won

    2

chhorn last won the day on April 29

chhorn had the most liked content!

Community Reputation

7 Neutral

About chhorn

  • Rank
    Regular Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. store in a session if the client was already on page 1.
  2. Have you checked every variable if it contains what you expect? Post results, and maybe the image you tested.
  3. Easiest way would be glob https://www.php.net/manual/en/function.glob.php
  4. If YOU don't know the problem, how should WE? At least there are PHP-tags missing.
  5. I would recommend not to use this low level functions. At best you take a database with ACID compatibility, if you want to get a quick slim start, use SQLite, it's mostly build-in into PHP. But at least you can use json_encode(), file_put_contents(), file_get_contents() and json_decode() for your task, so you have clean and readable interface without thinking too much. On the other hand, file handling and format manipulation is a valuable lesson. But as already said, you have to tell us what problem you encountered in detail.
  6. As to the manual, "die" is an alias of "exit" which is a function, and there are examples in the manual which you should try on a standalone script first, so you learn how to call functions with the appropriate syntax. https://www.php.net/manual/en/function.exit.php Also i would recommend to not just randomly copy and paste function signatures into production code and hoping that they work as you expect, but actually learn how PHP works and what syntax is needed from the examples.
  7. stop guessing: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  8. the DateTime class can handle a lot of default scenarious, including last x day of y, so all you need is the year and month component <?php $d = new DateTime('2019-10-01'); $d->modify('last friday'); print_r($d); // 2019-09-27 $d = new DateTime('2019-11-01'); $d->modify('last friday'); print_r($d); // 2019-09-25 $d = new DateTime('2019-12-01'); $d->modify('last friday'); print_r($d); // 2019-09-29
  9. Just use that .jpg name within the URL and redirect to a .php script with mod_rewrite.
  10. Espacially this: https://phpdelusions.net/pdo#fetch as it looks like you have mostly anything else. Also have a look at print_r(), var_dump(), htmlspecialchars(), Template Engines and XSS (cross site scripting).
  11. I don't see anything that is related to image manipulation in your code. You may want to read this: https://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/
  12. chhorn

    php error

    More important: What did you try to solve it?
  13. Store the session somewhere you have exclusive control of. Solutions are alreaday mentioned here.
  14. chhorn

    php Controls

    If you want some lightwight and simple to get started, you could even have a look at Notepad++
  15. If you get the error "call to a member function xy on bool" in context of database queries you can (mostly) think of an error within your sql statement. On your development machine you should always enable throwing errors: $pdo = new PDO('mysql:host=localhost;dbname=someTable', 'username', 'password', [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ]);
×
×
  • 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.