|
News Driven Pages
Have you ever wanted one of those sites with a
collection of news items but cannot be bothered with all the
work , then this for you. We will use an Access database and
then create a form in which the webmaster inputs the latest
news which will comprise of the title , description , url and
author of the news item. We then add this data to our database
and then display the 5 latest news items on a page.
Step 1
Create the database called latestnews , in this
case we used Access 2000 . Here is a picture of our completed
table which we also called latestnews .

Step 2
We create a form to enter the tile , description
, author and url fields . WE will use a VBScript date/time function
to store the submitted field.
Here is our form code.
<form action ="latestnews1.php"
method = "post">
<table>
<tr>
<td>title</td>
<td>
<input type ="text" name = "title">
</td>
</tr>
<tr>
<td>author</td>
<td>
<input type ="text" name = "author">
</td>
</tr>
<tr>
<td>description</td>
<td>
<textarea name ="desc" rows = "5" cols
= "50" wrap="VIRTUAL"></textarea>
</td>
</tr>
<tr>
<td>url</td>
<td>
<input type ="text" name ="url">
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit">
</td>
<td>
<input type = "reset" name="reset">
</td>
</tr>
</table>
</form>
Which creates a form like this

In the next part we will show you the code to
add an entry to our database and also then display the latest
news items.
Go To Part 2
|