What's new

PHP Pa help po! baka may matulong kayo

phforce32

Honorary Poster
Established
Joined
Jun 27, 2014
Posts
609
Reaction
114
Points
220
HELP.PNG



Ano kaya possible error po?

Thanks po sa makasagot
 

Attachments

Hello! To assist you accurately and effectively, I'll need more information about your problem. Please provide details such as:

1. What programming language are you using?
2. Can you provide the code that is causing the problem?
3. Have you received any error messages? If so, what do they say?
4. What were you trying to accomplish with your code?

Don't worry, I'm here to help you. We just need more context to solve this issue.
 
Hello! To assist you accurately and effectively, I'll need more information about your problem. Please provide details such as:

1. What programming language are you using?
2. Can you provide the code that is causing the problem?
3. Have you received any error messages? If so, what do they say?
4. What were you trying to accomplish with your code?

Don't worry, I'm here to help you. We just need more context to solve this issue.

1.PHP MySQL

2.
<div class="container">

<i class="icon-calendar icon-large"></i>
<?php
$Today = date('y:m:d',mktime());
$new = date('l, F d, Y', strtotime($Today));
echo $new;
?><br><br>

3. Fatal error: Uncaught ArgumentCountError: mktime() expects at least 1 argument, 0 given in C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php:238 Stack trace: #0 C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php(238): mktime() #1 {main} thrown in C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php on line 238

4. I want my home page to run smoothly without errors
 
1.PHP MySQL

2.
<div class="container">

<i class="icon-calendar icon-large"></i>
<?php
$Today = date('y:m:d',mktime());
$new = date('l, F d, Y', strtotime($Today));
echo $new;
?><br><br>

3. Fatal error: Uncaught ArgumentCountError: mktime() expects at least 1 argument, 0 given in C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php:238 Stack trace: #0 C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php(238): mktime() #1 {main} thrown in C:\xampp\htdocs\pharmacy-mgmt-php-master\home.php on line 238

4. I want my home page to run smoothly without errors
Thank you for providing additional information. The error you're encountering is because mktime() function expects at least one argument but you are not providing any.

The mktime() function in PHP is used to return the Unix timestamp for a date. It expects up to six parameters representing the hour, minute, second, month, day, and year respectively. If no parameters are given, the function will return a timestamp for the current time.

Since you are trying to get the current date, you do not need to use mktime() at all. You can simply use the date() function.

Here's how your code should look:

PHP:
<div class="container">

    <i class="icon-calendar icon-large"></i>
                <?php
                $Today = date('y:m:d');
                $new = date('l, F d, Y', strtotime($Today));
                echo $new;
                ?><br><br>

In this code, date('y:m:d') will return the current date in 'year:month:day' format, and strtotime($Today) will convert this date string into a Unix timestamp which is used by the second date() function to output the date in the 'Day, Month day, Year' format.

Please replace your existing code with the updated code and let me know if you encounter any other issues. I'm here to help!
 

Similar threads

Back
Top