Jump to content

Moorcam

Members
  • Posts

    278
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Moorcam

  1. You are opening the file using the localhost URL, right? Not right-clicking on the file and selecting open in Chrome or whatever?
  2. Try some proper error handling to get more insight: if ($results === false) { // Handle the error echo "Error executing query: " . mysqli_error($con); } else { while ($line = mysqli_fetch_assoc($results)) { // Process each line of results // Example: echo $line['event']; } }
  3. There could be many reasons for this to happen. It sounds to me like server processing time or network latency. You could try implementing a debounce function to limit the number of requests sent to the server when the user hovers over the button multiple times in quick succession.
  4. You need to make sure that the session is started correctly and that the session ID is set before any output is sent to the browser.
  5. Why do Java developers wear glasses? Because they don’t C#!
  6. Welcome Jerry!
  7. Place your code insode code blocks. Like so... Code here...
  8. You need to ensure that $fdw is initialized properly before it is used. $fdw is expected to hold a date string, but if it is not initialized before the form is submitted, the DateTime constructor will throw an error. What does your error logs say?
  9. Just a thought here. Are the teachers and supervisors saved as an Array in the database? If they are, this could be the issue because PHP has issues displaying data to a certain user based on ID or username or whatever because it also retrieves the data from the database including the [""], for example, ["teacher"], ["supervisor"]. Just a thought.
  10. You will be best contacting your hosting provider as it could be a combination of different things. But as was stated, the error is indicating that the username or password or both are wrong. It could also be a privilege issue or a misconfigured PhpMyAdmin.
  11. Let’s settle a debate that’s been raging (in my head, at least) for years: What’s the best PHP IDE or framework? Personally, I’ve hopped around like a caffeinated squirrel trying to find "the one." VS Code is my current IDE of choice because extensions are basically cheat codes for lazy developers like me. But I still have a soft spot for PHPStorm—despite it being the IDE equivalent of a luxury car. Sure, it’s fast and powerful, but does it have to cost as much as my coffee addiction? As for frameworks, I’ve dabbled with Laravel, Symfony, and CodeIgniter. Laravel feels like PHP on training wheels—smooth, elegant, and ready to do the heavy lifting. Symfony, on the other hand, is like the DIY kit of frameworks: powerful but occasionally makes you question your life choices. And CodeIgniter? It’s the scrappy underdog that still gets the job done when you just need something lightweight. However, I still love it raw like my steaks! (not really). So, here’s what I want to know from you: IDE or Editor: Do you swear by VS Code, dream in PHPStorm, or bravely code in Notepad++? Framework: Are you a Laravel evangelist, a Symfony purist, or a CodeIgniter minimalist? Or are you a rebel coding in plain PHP and laughing in the face of frameworks? Bonus points for any funny stories—like the time you spent 2 hours debugging only to find out you forgot a semicolon (we’ve all been there. Like me just today). Let’s hear it! Enlighten me, entertain me, and most importantly, help me justify my next subscription or Lucozade binge. Cheers! Dan
  12. Hi, I am Dan. I’ve been designing web applications—on and off—since 2001, back when animated GIFs were all the rage and ‘responsive design’ meant answering your client’s emails. Over the past 14 years, I’ve tried to keep pace with the ever-evolving trends in web development, successfully delivering a variety of projects that made my clients happy (and kept me caffeinated). I specialize in PHP development, including experience with MySQLi and PDO for database integration, and I’m well-versed in JavaScript (both vanilla and frameworks like jQuery), Python, and more. Whether it’s building efficient back-end systems, creating dynamic front-end experiences, or troubleshooting complex issues, I’m always up for a challenge. Need custom work done? Pop me an email—let’s make something awesome together! [email protected] My website: www.danoriordan.com
  13. That's ok. We all learn as we go along As Barand said above, the syntax you need is in the foreach loop. Try this. Replace your function list_holidays with this: function list_holidays(DateTimeInterface $date): bool { $year = (int) $date->format('Y'); foreach (get_holidays($year) as $holiday_name => $holiday_date) { $holiday_formatted = $holiday_date->format('Y-m-d'); echo "$holiday_name is $holiday_formatted\n"; } return true; // Added return statement for consistency } Look at the code above, get familiar with what it does. That's how you learn. We are now using the foreach loop to retrieve the holiday name and holiday date. This should now output in the way you want. See how it goes Doing a quick Google (we all know Dr. Google knows everything, right?) It explains what a foreach loop is:
  14. Oh ok. I thought it was something you created yourself. You will probably need to contact the developer to help you resolve it. It's a premium script so free support comes with it.
  15. Congratulations, you've just entered a world where semicolons make or break friendships, and "Hello, World!" is always the first step toward global domination (or at least functional code). Feel free to dive into discussions, share your bugs (we won't squash them... immediately), and remember: there’s no such thing as a dumb question—just infinite ways to ask it! Happy coding, and may your syntax always be error-free!
  16. The loop iterates over the holidays array, but it does not access the keys (holiday names) associated with the DateTime objects. Modify the foreach loop in the list_holidays function to include both the holiday names and their corresponding dates.
  17. Hi. Without the actual script it's hard to pinpoint what the error is telling you. In plain English it's telling you that the format is not supported or isn't found. But it could be due to many other reasons.
  18. You can add a usort function, which sorts the $files1 array based on the modification time of each file. Something like this: usort($files1, function($a, $b) { return filemtime($b) - filemtime($a); }); I would also recommend using htmlspecialchars for added security. Hope this helps.
  19. I'm no expert but the error you are getting is indicating that you may need to login to Docker or the repo doesn't exist. Check the repo name and your access rights, I guess.
  20. It would be interesting to see the full code for authentication.
  21. The password value here: <input size="20" maxlength="20" name="password" value'" "> This is wrong. You have a single quote before the double quote. This can lead to issues in different browsers.
  22. The root cause of the problem lies in the fetchProductsUsingModel method, which is expected to return an array of products but does not define or initialize the $products variable. This oversight will result in a Notice: Undefined variable error when the method is invoked. public function fetchProductsUsingModel(): array { // Assuming you have a model to fetch products, replace this with actual fetching logic $products = []; // Initialize the products array // Example logic to fetch products (this should be replaced with actual implementation) // $products = $this->productRepository->getList($searchCriteria)->getItems(); return $products; // Return the fetched products } Make sure to replace the placeholder logic with the actual implementation that retrieves products from your Magento store.
  23. The session parameters are set to a very high value (315360000 seconds, which is approximately 10 years). While this is not inherently a bug, it may lead to unexpected behaviour if not managed properly, especially in terms of security and session expiration. The code includes a file named Connection.php, but there is no error handling to check if the connection was successful. If the connection fails, the subsequent database operations will not work. The code checks if the session variable uid is set, but it does not handle the case where the session is not set, which could lead to unexpected behaviour.
  24. I replied to your post on another forum.
  25. The provided code does not include any session management, which results in users being logged out upon closing the application. To keep users logged in until they manually log out, you can implement a session management strategy using cookies or local storage.
×
×
  • 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.