Jump to content

Category and datetime field.


wizzkid

Recommended Posts

Hello,

 

I am trying create a news article, but I have few category in it. Can you help me to create an "add article form" which has dropdown list of category that I can choose, so when I select "Announcement" it will save the data on my mysql database under announcement table. sample html form below.

 

<form id="form1" name="form1" method="post" action="">

  <label>

  Category :

  <select name="category" id="category">

    <option>--- choose category ---</option>

    <option>News</option>

    <option>Announcement</option>

    <option>Sports</option>

  </select>

  </label>

  <br />

  Date: <br />

  Title:

  <label>

  <input type="text" name="title" id="title" />

  </label>

  <br />

  Body:

  <label>

  <textarea name="body" id="body" cols="45" rows="5"></textarea>

  </label>

  <br />

  <label>

  <input type="submit" name="Submit" id="Submit" value="Submit" />

  </label>

  <br />

  <br />

</form>

 

Can you tell me how to create the php code which support the above html.

 

Also, I would like to have a date and time on my article, but I want it automatically get the time and date from the computer of the client, so the user will not put it manually. can you point me to the correct code?

 

 

Thanks and hope you can help me! :D

Link to comment
Share on other sites

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.