Jump to content

chhorn

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by chhorn

  1. if you dont have a redis server running, stick to using a file with the functions provided by @kicken - the logic is pretty easy # pseudo code if(file_age > 5 minutes) save api data to file; get data from file;
  2. that's because your update statement is broken. add line breaks to that statement to determine the line that is wrong and think about what could be wrong.
  3. you strpos() for the first comma, substr() the string into $quantity and $identifier, then create $countable[$identifier] and assign $quantity if not exists, or add up.
  4. setFrom is a function $mail->setFrom('from@example.com', 'Mailer'); have a look at the documentation https://github.com/PHPMailer/PHPMailer
  5. Tipp: keep your ears open to the term "rainbow tables"
  6. Maybe you read the FAQ of this forum first:
  7. Yes, windows OS, there's a linux hint in the thread: https://stackoverflow.com/questions/8773043/how-to-play-a-sound-file-using-php-script-only
  8. the only hint i found was something like exec('powershell -c (New-Object Media.SoundPlayer "C:\Windows\Media\notify.wav").PlaySync();'); but that's at least windows OS specific, but actually worked on my machine
  9. if the software runs on your machine with enough priviledges you can play a sound by using exec() with appropriate comand line arguments to a local mp3-player.
  10. that really depends on your task and the data.
  11. It's not a bug, parsing print_r is not an inteded feature. if you still think it's a bug, you can just open an issue in the bugtracker, but i bet you get a similar answer.
  12. print_r is just a debug function without any format expectations. parsing this is mostly wrong. use a proper data exchange format.
  13. And what's the sql statement then? What data do you expect to show up on that condition? Show an example of both.
  14. This depends on the image format an what exactly "resizing" means in this way. When you use the compression feature of PNG the dimensions of that image (width, height, color depth) stay the same and that process is perfectly reversible as PNG is a lossless format, the codec just tries to put as much information as possible into as less bytes as needed, this may result in higher CPU usage. Using JPEG compression you destroy image details and it's irreversible. If you change any dimension or cut something off of your image that information is lost, no matter what format you use. But for the exact details i recommend reading the specification of the image codec.
  15. you are updating the record after displaying it. check https://en.wikipedia.org/wiki/IPO_model also $Submit is never defined, check https://www.php.net/manual/en/security.globals.php
  16. replace print_r with var_dump to see what the variables actually contain. Check every condition if it really matches your expected values, like var_dump($residue) and so on. As this is a recursive function it may be of interest to have a static iteration number and all given function arguments to display. As this is a working example (good!) you can test this first online to see if may be a configuration issue on your machine https://3v4l.org/VC646
  17. if that info is still in the URL you coudl extract that https://www.php.net/manual/en/function.parse-url.php if it's contained in the sourcecode of that page you can try to read this out https://www.php.net/manual/en/book.simplexml.php
  18. just use the DateTime class with the diff method.
  19. so what now? you are sending the ID twice. _If you want to insert, use some other ID. if you want to replace, use an UPDATE statement.
  20. Looks like you just have to skip some parts var_dump(new DateTime('Sun, Feb 9 3:00 PM')); /** object(DateTime)#1 (3) { ["date"]=> string(26) "2020-02-09 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } then modify() and format().
  21. Or SELECT DATE(timestamp) = CURDATE() -- true or false FROM mytable WHERE whatever
  22. location.href = 'foo.php?data='+json.html var_dump($_GET['data']); maybe you need to escape that somehow. Or use AJAX.
×
×
  • 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.