Jump to content

Automatically make a site


Anders Moen

Recommended Posts

view_topic.php is the page it gets the id and goes to the database and loads the data on view_topic.php. When there is a different id it loads different data. That is what we have been trying to explain to you...that is a dynamic page.

Link to comment
Share on other sites

It'd be just like justsomeguy posted:

<?php$id = intval($_GET['id']); //news.php?id=xxx$result = mysql_query("SELECT * FROM news WHERE id={$id}");if (!($news = mysql_fetch_assoc($result)))  die("No news item found");mysql_free_result($result);echo "<div class=\"headline\">" . htmlentities($news['title']) . "</div>";echo "<div class=\"newsbody\">" . nl2br(htmlentities($news['body'])) . "</div>";?>

It will display any news item, and you only have to change this code if you want all news items to change.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...