Jump to content
  • Who's Online   0 Members, 1 Anonymous, 112 Guests (See full list)

    • There are no registered users currently online

All Activity

This stream auto-updates

  1. Today
  2. MatkaSoftware is one of the leading Satta Matka software development companies in India, known for creating secure, fast, and user-friendly Matka platforms. They specialize in custom Matka app and website development with real-time results, modern features, and seamless performance for a top-class gaming experience.
  3. Yesterday
  4. There are a few different ways to process the stats based on what game and mod you are running. The one that is giving me the error is based on savestate 1 which continues from the last saved game log file. Savestate 0 runs without errors, but processes every game log file all over again every time. This is the from the batch file I use to tun the stats: C:\xampp\php\php.exe -f "C:\xampp\htdocs\q3eplus.servequake.com\vsp.php" -- -l q3a-xp -p savestate 1 "D:\Quake III Arena\excessiveplus\logs\server_mp.log"
  5. Suyadi's comment is factually accurate. The code expects the constant value LOG_READ_SIZE, and it is not defined. WIth that said, often utility applications come with instructions on how they should be configured, it looks like this might be the case for the application. Check instructions and see if there is a configuration file that needs to exist in a particular place. Many applications are distributed with a file with default settings that needs to be copied and renamed.
  6. 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);
  7. 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
  8. 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
  9. 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);
  10. $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] => )
  11. $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');
  12. Adding question marks helped! Silly me! 😧 Using barands code displays all picures on the smae page while i'm trying to create a folder. Http://inflorescence.infy.uk/tryout.php
  13. The file is in the main folder where to upload the website. Let me try to use the correct inclusief code. That might help. I'll get back as soon as i've tried that.
  14. I'm using a game stats processor called VSP stats which parses game logs and displays the output to a web page. The issue I'm having is that it stops processing the logs with the following error: PHP Fatal error: Uncaught Error: Undefined constant "LOG_READ_SIZE". The line of code that is causing the error: $seekResult = fseek($parser->logFileHandle, -LOG_READ_SIZE, SEEK_CUR); Server is on Windows 11 Apache 2.4.58 PHP 8.2.12.
  15. what exactly is the single $booked data for vs the array of $bookings? i have the following recommendations - use a standard yyyy-mm-dd date format. if/when you store the data in a database, this will be necessary to allow queries to compare dates by order. it will also make your current code easier to understand. the bookings data should be stored in a database table. you should have a start_date and an end_date input to the code on this page, so that the code will work for any date range, from multiple years down to a single month. you are looping over the $res array for every date being displayed, currently for the whole year. i recommend that you instead produce an array using the date as the array index, and the stored value indicating what is occurring on that date, limited to be between the start_date and end_date mentioned above. as you are producing the output, you can simply test, no loop required, if there is an entry in this array, using isset(), then get the stored value if there is one, and use it to control what you output for the date. with a little conditional logic, you don't need separate logic to deal with the first (partial) week, then repeat that logic for the remainder of each month. if you use php's short-open-print tag and leave out the ; right before a closing tag, you can use simple syntax like - <?=$some_var?> to output values in the markup. use php's DateInterval and DatePeriod to expand the booking date ranges. here's example code for item #7 - $start = new DateTime($start); $end = new DateTime($end); $end = $end->modify('+1 day'); // include the end point $interval = new DateInterval('P1D'); // 1 day $daterange = new DatePeriod($start, $interval ,$end); $dates = array(); foreach($daterange as $date){ $dates[] = $date->format("Y-m-d"); }
  16. Last week
  17. First, your two includes at the top and bottom of the page are not within correct PHP tags. Need a ? before the starting PHP. The DIV in your code is in the HTML source, but there is nothing within it. That would seem to indicate that there was no content in the $images array. I'm guessing that the path you provided to the glob function is not correct. Where is the 'photography' folder in relation to where the php file is being executed?
  18. In a past life, have experience turning dynamic, user generated content via a web page into print-ready PDFs for commercial printing. In that case, the user input on the web forms was converted into PostScript code that was then run through a processing engine (my expertise was in the postscript programming). So, when I had a need to generate PDFs as a PHP hobbyist, I looked for a solution where I could "program" the creation of the PDF in the same way as I did with PostScript. I ended up using the FPDF Library. If you have fairly rigid constraints on the layout of the content, this could be an option. Instead of generating an HTML page and running that through something to convert it to a PDF, this library allows you to create a PFD file in much the same way you would create a web page. I.e. determine "where" on the page you want to put an element, define things like color, font, and then place the elements on the page. However, there is another, simpler option. Instead of emailing the user a PDF, just send the user a link. That link would be to a web page of their quote and then the user can print the web page quote to PDF, the printer, or however they want. I think most shopping sites I use have this approach if I want to print the invoice. This much simpler and less moving parts, IMO.
  19. http://inflorescence.infy.uk/tryout.php
  20. When people are using tutorials to try and create PHP based features, there are pitfalls, the potential for misunderstandings and the possibility of error. We need to see what your actual code is. The only exception is in the case of passwords, keys etc. Those should be replaced. So we would need to see your code and the actual path you used in your code. The operating system, hosting location etc, is also important information in many cases. It sounds like you have error turned off at present, and for development, errors need to be turned on, so you can see what they are. It looks like your code has one or more errors in it, and that is why you are getting a blank page, but if errors are turned off, you can't see what the error message is.
  21. Thank you Barand! It still gives a blank page though.
  22. I'm Trying to create a booking/availability calendar that shows a full 12 months bookings/availability. I have come up with the following so far $publicHolidays = array(date('j-n-Y', strtotime('1st January 2025')), date('j-n-Y', strtotime('18th April 2025')), date('j-n-Y', strtotime('21st April 2025')), date('j-n-Y', strtotime('5th May 2025')), date('j-n-Y', strtotime('26th May 2025')), date('j-n-Y', strtotime('25th August 2025')), date('j-n-Y', strtotime('25th December 2025')), date('j-n-Y', strtotime('26th December 2025'))); $bookings = array(array('Check-In' => '1-1-2025', 'Check-Out' => '7-1-2025'), array('Check-In' => '3-2-2025', 'Check-Out' => '13-2-2025'), array('Check-In' => '2-3-2025', 'Check-Out' => '25-3-2025'), array('Check-In' => '2-4-2025', 'Check-Out' => '21-4-2025'), array('Check-In' => '6-6-2025', 'Check-Out' => '9-6-2025'), array('Check-In' => '2-9-2025', 'Check-Out' => '5-9-2025'), array('Check-In' => '3-11-2025', 'Check-Out' => '30-11-2025')); foreach($bookings as $row) { $res[] = Cal::bookedArray($row['Check-In'],$row['Check-Out']); } $booked = Cal::bookedArray('1-4-2025','7-4-2025'); $month = '1'; $year = date('Y'); for($m=$month;$m<13;$m++) { $timestamp = mktime(0, 0, 0, $m, 1, $year); $daysInMonth = date("t", $timestamp); $firstDay = date("N", $timestamp); if($m == date('m')) { $featured =' featured'; } else { $featured=''; } ?> <div class="col-xl-4 col-lg-6" data-aos="fade-up" data-aos-delay="100"> <div class="pricing-item p-0<?php echo $featured;?>"> <h3 class="mb-0 pt-5"><?php echo date('F', mktime(0,0,0,$m)); ?></h3> <table class="table table-bordered m-0"> <tr> <th>Mon</th> <th>Tue</th> <th>Wed</th> <th>Thu</th> <th>Fri</th> <th>Sat</th> <th>Sun</th> </tr> <?php $dayCount = 1; ?> <tr> <?php for ($i = 1; $i <= 7; $i++) { $date = "$dayCount-$m-$year"; if ($i < $firstDay) { echo "<td></td>"; } else { $date = "$dayCount-$m-$year"; if(date('l', strtotime($date)) == 'Saturday' && !in_array($date, $booked)) { $cellBg="class='table-info'"; } elseif(date('l', strtotime($date)) == 'Sunday' && !in_array($date, $booked)) { $cellBg="class='table-info'"; } elseif(in_array($date, $publicHolidays) && !in_array($date, $booked)) { $cellBg="class='table-warning'"; } else { $cellBg="class='table-light'"; } foreach($res as $key => $val) { /* $firstday = reset($val); $lastday = end($val); if($date = $firstday) { $cellBg="class='table-primary'"; } elseif(in_array($date, array_splice($val,1,-1))) { $cellBg="class='table-danger'"; } elseif($date = $lastday) { $cellBg="class='table-primary'"; } */ if(in_array($date, array_splice($val,1,-1))) { $cellBg="class='table-danger'"; } } echo "<td $cellBg>$dayCount</td>"; $dayCount++; } } echo "</tr>"; while ($dayCount <= $daysInMonth) { echo "<tr>"; for ($i = 1; $i <= 7 && $dayCount <= $daysInMonth; $i++) { $date = "$dayCount-$m-$year"; if(date('l', strtotime($date)) == 'Saturday' && !in_array($date, $booked)) { $cellBg="class='table-info'"; } elseif(date('l', strtotime($date)) == 'Sunday' && !in_array($date, $booked)) { $cellBg="class='table-info'"; } elseif(in_array($date, $publicHolidays) && !in_array($date, $booked)) { $cellBg="class='table-warning'"; } else { $cellBg="class='table-light'"; } foreach($res as $key => $val) { /* $firstday = reset($val); $lastday = end($val); if($date = $firstday) { $cellBg="class='table-primary'"; } elseif(in_array($date, array_splice($val,1,-1))) { $cellBg="class='table-danger'"; } elseif($date = $lastday) { $cellBg="class='table-primary'"; } */ if(in_array($date, array_splice($val,1,-1))) { $cellBg="class='table-danger'"; } } echo "<td $cellBg>$dayCount</td>"; $dayCount++; } ?> </tr> <?php } ?> </table> </div> </div> <?php } Its reading the arrays, drawing the calendar and colorizing the weekends, public holidays and bookings. What i need is to change the check-in and check-out date color to reflect what they are. I've commented out what ive been trying but it isnt working. here is the bookedarray function if anyone needs it public static function bookedArray($strDateFrom,$strDateTo) { $aryRange = []; $iDateFrom = strtotime($strDateFrom); $iDateTo = strtotime($strDateTo); if ($iDateTo >= $iDateFrom) { array_push($aryRange, date('j-n-Y', $iDateFrom)); // first entry while ($iDateFrom<$iDateTo) { $iDateFrom += 86400; // add 24 hours array_push($aryRange, date('j-n-Y', $iDateFrom)); } } return $aryRange; } Any help would be much appreciated or even a pointer as to were I could find a solution Thanks in advance
  23. <?php $images = glob("path/to/folder a/*.*"); foreach ($images as $i) { echo "<img src='$i'>"; }
  24. I'm stuck on this code: <div class="gallery"><?php $images = glob(FOLDER A); foreach ($images as $i) { printf("<img src='FOLDER A...'>"); } ?></div> https://code-boxx.com/simple-php-image-gallery/ What needs to be replaced in "FOLDER A" do I need forward slashes? ("/") Tutorial here: https://code-boxx.com/simple-php-image-gallery/
  25. What's the problem with installing composer? Takes 2 seconds, and that is what PHP uses for dependency management and autoload building. Every option you have is going to start with using composer, and not using it is going back to PHP development as it was done in the bad old days of copying entire library codebases into project directories and everything that was painful, error prone and annoying with PHP library use, as of 10+ years ago. As for "best path" there really isn't one. There are different technical approaches to the problem, that tend to have different requirements, gotchas and limitations. You are best off doing a quick evaluation using the html docs you already have to explore the libraries. One up and coming option you didn't mention is gotenberg: a sophisticated go based conversion engine that has a php api. It has a lot going for it, but also has more moving parts. Here's the PHP Api that lets you talk to the Gotenberg server: https://github.com/gotenberg/gotenberg-php Puppeter (or rather the PHP api to it) takes a similar approach, in that it's a bridge to a headless browser used to render a page, which then allows you to save a pdf version. The https://github.com/zoonru/puphpeteer library is still being maintained, but already it's a fork of the original. You also have more moving parts (depending on Node, and the rialto bridge to Node). jspdf has similar issues, being a js library. For the Pure PHP library options, I'd start with dompdf and see if that works for you. Known limitations are the lack of support for flexbox or grid, so that might be a deal breaker. I probably wouldn't use mpdf, due to the age and lack of updates. It's a fork of fpdf. With that said, not unlike dompdf, if you constrain your html it might be fine for your use case, but the lack of updates is not a great sign. Along those same lines, lots of people are still using Snappy https://github.com/KnpLabs/snappy particularly with Laravel or Symfony, since there are integrations for both of those, but it does depend on a https://wkhtmltopdf.org/ which is now a dead project, even though you can still get builds of it for most linux distros.
  26. See gw1500se and mac_guyver's posts, and implement those changes. One other thing I noted in your code, is that when you mix PHP and HTML, it's best to use PHP Alternative syntax for control structures. For the if -then - else section of your code, here is how you would change that. <?php if ($isadmin): ?> <ul class="navbar-nav"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Hello, <?= $thename ?> </a> <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <li><a class="dropdown-item" href="main.php">TLS Materials</a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="logout.php">Logout</a></li> </ul> </li> </ul> <?php elseif ($authenticated): ?> <img src='/files/<?=$theimage ?>' width="75px"> <ul class="navbar-nav"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle text-dark" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"><?= $thename ?> </a> <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <li><a class="dropdown-item" href="profile.php">My Profile</a></li> <li><a class="dropdown-item" href="main.php">TLS Materials</a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="logout.php">Logout</a></li> </ul> </li> </ul> <?php else: ?> <ul class="navbar-nav"> <li class="navbar-item"> <a href="register.php" class="btn btn-outline-primary me-2">Register</a> </li> <li class="navbar-item"> <a href="login.php" class="btn btn-primary">Login</a> </li> </ul> <?php endif; ?>
  27. strtotime() returns a unix timestamp value. Timestamps are an integer value which is the number of seconds since the January 1, 1970 00:00:00 UTC. Helpers like "+10 minute" are nice for abstraction, but all the minute addition does is add (minutes * 60) to the value. So you might note that this code will print "Same". $t1 = strtotime("now") + 10 * 60; $t2 = strtotime("+10 Minute"); if ($t1 == $t2) { echo "Same\n"; } An important limitation of strtotime is that it doesn't have any concept of timezone, so in most cases you should use PHP DateTime classes, which do allow you to account for timezones and translate between them. You also need to be aware of what the configured locale settings of your server are. In most cases servers should be setup to be UTC, and thus datetime values set in the database will also be UTC. This is the best practice. When you develop your application you want to be aware of the server and PHP settings, and translate the date/time values at presentation time, by applying the desired timezone relevant to your server or the client.
  28. Well, crap - I meant to link to the page as a whole, not the anchor tag. Thanks for the correction!
  1. Load more activity
×
×
  • 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.