Location: PHPKode > projects > News manager > index.php
  //load configuration
  //connect to database
  @mysql_connect($db_server,$db_user,$db_password) or die("Database server connection failed. Check variables \$db_server, \$db_user and \$db_password in config.php");
  @mysql_select_db($db_name) or die("Selecting database failed. Check variable \$db_name in config.php");
  //print header
  echo $header;
<h1><?php echo $title; ?></h1>
  //print news
  $result = @mysql_query("SELECT * FROM $db_table ORDER BY date DESC LIMIT 0,$shownews;");

    ?><p><strong><?php echo date("m/d/Y - H:i",$row["date"]); ?></strong></p>
    <p><?php echo $row["news"]; ?></p><?php
    if($row["links"] != ""){

      $links = explode(",",$row["links"]);

      foreach($links as $link){
        ?><li><a href="<?php echo $link; ?>" target="_blank"><?php echo $link; ?></a></li><?php

  //print link to administration
  ?><p align="right"><a href="admin.php">Administration</a></p><?php
  //print footer
  echo $footer;

  //close database connection
Return current item: News manager