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
https://forums.phpfreaks.com/topic/214625-category-and-datetime-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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