Jump to content

Suyadi

New Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Suyadi

  1. That means it's not defined anywhere on that file so PHP can't find it. My suggestion would be to raise this issue to the developer of that script as the developer seems forgot to define that constant in their code. Those LOG_READ_SIZE constant used to set the offset of the fseek() and we don't know how big he set those number. my wild guess is as big as the log file size, so: defined('LOG_READ_SIZE') or define('LOG_READ_SIZE', filesize($logfilePath)); $seekResult = fseek($parser->logFileHandle, -LOG_READ_SIZE, SEEK_CUR);
  2. This is correct, the length of string produced by password_hash() with default algorithm (bcrypt, as of now) is always 60 characters. So if you do password_hash('mypassword', PASSWORD_DEFAULT); and your database column can only store less than 60 characters, it will be truncated with some error being thrown
  3. Lol, me too That should be: $sql = $pdoObject->prepare($qry); $result = $sql->execute(['exp' => null, 'email' => $myusername]); As the PDOStatement::execute only accept one parameter. Reference: https://www.php.net/manual/en/pdostatement.execute.php
  4. HI, you can try to use glob() with the __DIR__ constant. For example: $currentDir = __DIR__; // this is your current directory So, if you want to scan images inside your sub-directory, let's say the 'gallery' directory, just do: $subDirectory = 'gallery'; $images = glob($currentDir . '/' . $subDirectory . '/*.{jpg,jpeg,gif,png,bmp,webp}', GLOB_BRACE); Check the result: print_r($images);
  5. $timezone = 'Asia/Jakarta'; // Change this $dbTime = '2025-04-26 20:30:00'; $dbTime = DateTime::createFromFormat('Y-m-d H:i:s', $dbTime, new DateTimeZone($timezone)); $now = new DateTime('now', new DateTimeZone($timezone)); print_r($dbTime->diff($now)); print_r($now->diff($dbTime)); Result: DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 2 [i] => 13 [s] => 10 [f] => 0.828 [invert] => 0 [days] => 5 [from_string] => ) DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 2 [i] => 13 [s] => 10 [f] => 0.828 [invert] => 1 [days] => 5 [from_string] => )
  6. $timezone = 'Asia/Jakarta'; // Change this $date = new DateTime('now',new DateTimeZone($timezone)); $date->modify('+10 minute'); echo $date->format('Y-m-d H:i:s');
×
×
  • 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.