Jump to content

how to insert auto current date inside this tag please help?


Recommended Posts

No I don't think that will work.   Perhaps you can see what the errors are if you LOOK at it a bit longer.   The very first response to this topic was truly exactly what you asked for though.  Although I don't know what you meant by using the word "AUTO" in your request.

Here is what you should see if you actually tried out your code like this:

$outgoing_date = "CURRENT_DATE()";
echo "1. outgoing_date: $outgoing_date<br>";
$outgoing_date = date("Y-m-d", strtotime($_POST['outgoing_date']));
echo "2. outgoing_date: $outgoing_date<br>";

And the output of this:

1. outgoing_date: CURRENT_DATE()

Notice: Undefined index: outgoing_date in /home/albany/public_html/homejg/test.php on line 19
2. outgoing_date: 1969-12-31

(Line 19 is line 3 in my above code)

15 hours ago, Ronel said:
$outgoing_date = "CURRENT_DATE()";
        $outgoing_date = date("Y-m-d", strtotime($_POST['outgoing_date']));

HOW ABOUT PASSING IT THROUGH THIS?  THEN I NEED TO PASS IT THROUGH INPUT TYPE WHICH IS INSIDE TD TAG

The biggest obstacle to that approach is that PHP does not have a CURRENT_DATE() function - it's a MySql function. If you had error reporting on, or used the reference manual, that would have given you a clue.

date('Y-m-d') will use the current date by default so all the extra code above is redundant - which takes us back to the original solution you were given, yet ignored.

  • Haha 1
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.