Jump to content

chhorn

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by chhorn

  1. lookup websockets.
  2. 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.
  3. you could have a look at what the server gives you back for that ajax request with console.log(data);
  4. 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.
  5. that code imsafe.zip is nowhere mentioned on this thread.
  6. 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 ));
  7. 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?
  8. So how should the array look like then?
  9. 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.
  10. Best way is tu query the APIs of the platforms if available.
  11. 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.
  12. First you have to find a source with ipv6 adressed countries, then you have to rewrite your script completely.
  13. You are fetching $_GET['listing_id'] from the URL, so you have to provide that info at least in a link.
  14. You can use a variable there: $photoFiles[$i] = $file; That variable $i can be initialised and incremented.
  15. 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.
  16. It's not that var_dump you posted. Just have a full search over all files for "phtoFiles", looks like a spelling mistake.
  17. store in a session if the client was already on page 1.
  18. Have you checked every variable if it contains what you expect? Post results, and maybe the image you tested.
  19. Easiest way would be glob https://www.php.net/manual/en/function.glob.php
  20. If YOU don't know the problem, how should WE? At least there are PHP-tags missing.
  21. 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.
  22. 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.
  23. stop guessing: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  24. 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
  25. 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.