Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by chhorn

  1. so if you want to look at some variable, you have to find it first. the variable is "data", and i only see the code you posted, so you hit ctrl+f on this page and type in "data" without the quotes, the only place you find this combination of charaters is within this code }).done(function(data){ form_status.find('.form-status-content').html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); }); and the variable is provided as a parameter into a function. so you go into this function and place the code i posted there. and hit F12 in your browser, go to console, befor making that request.
  2. you could have a look at what the server gives you back for that ajax request with console.log(data);
  3. coming from MySQL in the past, i'm working with PHP+Postgres nearly exclusive for the last 5 years or so. main reason is standards compatibility, so less surprises and less wasted time with debugging, but performance and built in features are also a cause, GIS capability is great.
  4. that code imsafe.zip is nowhere mentioned on this thread.
  5. then your query is invalid, enable error reporting $pdo = new PDO('mysql:host=localhost;dbname=someTable', 'username', 'password', array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ));
  6. If you don't know what to achieve, how should we? did you try to explode that string? is that the result you wanted? split the string up by what, with what result?
  7. I bet you need the avatar more often, so a new table would involve a join or at least a separat query every time. so if your users table does not seem to be flooded with columns anyway, or the user can store multiple avatars, maybe for historical reasons, i would stick on two columns within the users table for performance and maintainability - you still can simply let the column out on queries that don't need the data.
  8. Best way is tu query the APIs of the platforms if available.
  9. I bet the mailer won't care about any file extension, just use the one you expect it to be when the client opens the mail, at least then it would be a file anyway.
  10. First you have to find a source with ipv6 adressed countries, then you have to rewrite your script completely.
  11. You are fetching $_GET['listing_id'] from the URL, so you have to provide that info at least in a link.
  12. You can use a variable there: $photoFiles[$i] = $file; That variable $i can be initialised and incremented.
  13. 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.
  14. It's not that var_dump you posted. Just have a full search over all files for "phtoFiles", looks like a spelling mistake.
  15. store in a session if the client was already on page 1.
  16. Have you checked every variable if it contains what you expect? Post results, and maybe the image you tested.
  17. Easiest way would be glob https://www.php.net/manual/en/function.glob.php
  18. If YOU don't know the problem, how should WE? At least there are PHP-tags missing.
  19. 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.
  20. 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.
  21. stop guessing: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  22. 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
  23. Just use that .jpg name within the URL and redirect to a .php script with mod_rewrite.
  • 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.