Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:20:35+00:00 2026-06-13T17:20:35+00:00

I have a form that posts the Date, Title, Message and Image into an

  • 0

I have a form that posts the Date, Title, Message and Image into an SQL table. It all works fine, except the form, it has a field that I have to manually enter the date and time.

What I want to know is how can I get the PHP to get the date & time (GMT time) of when the form button is pressed and post it into the “time” section of my sql table instead of me doing it manually, I’m using this as a ultra lightweight CMS blog.

This is my insert.php

mysql_query("INSERT INTO Blog
(Date, Title, Message, Image)
VALUES('$_POST[Date]', '$_POST[Title]' , '$_POST[Message]' , '$_POST[Image]' ) ")
or die(mysql_error());

echo "1 record added";

This is my form

<form action="insert.php" method="post">
<span class="label">Date:       </span>     <input type="text" class="dateField" name="Date" />
<span class="label">Title:      </span>     <input type="text" class="titleField" name="Title" />
<span class="label">Message:    </span>     <textarea  name="Message" class="messageField" maxlength="1000" cols="0" rows="0"></textarea>
<span class="label">Image URL:      </span>     <input type="text" class="ImageField"  name="Image" />
<input type="submit" class="submitBtn"/>
</form>

I want the server to add the Time/Date instead of me typing it in manually. Is this easily done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:20:37+00:00Added an answer on June 13, 2026 at 5:20 pm
    mysql_query("INSERT INTO Blog (Date, Title, Message, Image) 
                VALUES(now(), '" . $_POST[Title] . "' , '" . $_POST[Message] . "' , 
                '" . $_POST[Image] . "' ) ") or die(mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP form that is inserting information into a database. It all
I have got a form that posts values to a page in a wizard.
I have a html form that posts to a new page on submit. If
I have a page that inserts records into a table. what i am having
First time poster, long time lurker :) I have a form setup that posts
I have a form that when submited posts to remote url using curl the
I have a simple form that looks like so <% remote_form_for post, :url =>
I have a page with a form on it that needs to post to
I currently have form that checks if a user has unsubmitted changes when they
I have a form that I'm submitting through AJAX. The form includes many fields,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.