Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


chhorn last won the day on April 29 2019

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. First you have to find a source with ipv6 adressed countries, then you have to rewrite your script completely.
  2. You are fetching $_GET['listing_id'] from the URL, so you have to provide that info at least in a link.
  3. You can use a variable there: $photoFiles[$i] = $file; That variable $i can be initialised and incremented.
  4. You have multiple error messages there. So if you get e.g. "City was not specified" you can check for var_dump($city); then for var_dump(trim($_POST["city"])); then for var_dump($_POST["city"]); then for var_dump($_POST); and look what each variable contains.
  5. It's not that var_dump you posted. Just have a full search over all files for "phtoFiles", looks like a spelling mistake.
  6. store in a session if the client was already on page 1.
  7. Have you checked every variable if it contains what you expect? Post results, and maybe the image you tested.
  8. Easiest way would be glob https://www.php.net/manual/en/function.glob.php
  9. If YOU don't know the problem, how should WE? At least there are PHP-tags missing.
  10. 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.
  11. 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.
  12. stop guessing: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  13. 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
  14. Just use that .jpg name within the URL and redirect to a .php script with mod_rewrite.
  15. 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).
  • 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.