Jump to content

News script


dean7

Recommended Posts

hi, for my website i have somthing like a news script so users can see whats new etc... but there is somthing wrong with it..

 

<html>
<head>
<link rel=stylesheet href=../../Backups/includes/in.css type=text/css>
<title>GG News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
body {

}
.style3 {color: #FFFFFF; font-weight: bold; }
-->
</style>
</head>

<body>
<table class=thinline width="80%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor=black>
  <tr>
    <td height="31" background="includes/grad.gif"><center class=bold>
      <span class="style1">Latest News      </span>
    </center></td>
  </tr>

  <tr>
    <td bgcolor="#000000">
<?php $select_updates=mysql_query("SELECT * FROM updates ORDER BY id DESC");
while($the=mysql_fetch_object($select_updates)){

echo "$the->update<p>";

echo "Added by: : <A href='profile.php?viewuser=$the->username'>$the->username</a> Date: : $the->time";
echo "<br>";
}
?>	</td>
  </tr>
</table>
<br>
<br>
<?php if ($fetch->userlevel == "owner"){ 
if (strip_tags($_POST['submit']) && (strip_tags($_POST['update'] != "0"))){
$update=strip_tags($_POST['update']);
$date = gmdate('Y-m-d h:i:s');
mysql_query("INSERT INTO `updates` ( `id` , `username` , `time` , `update` ) 
VALUES (
'', '$username', '$date', '$update'
)");
echo "<font color=white><b>News Added</font>";
}


?>
<form name="form1" method="post" action="">
  <table width="25%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#000000">
    <tr> 
      <td><table width="89%" border="0" cellspacing="3" cellpadding="0">
          <tr>
            <td height=29 bordercolor="#000000" background="includes/grad.gif" bgcolor="#000000"><div align="center"><span class="style3">Add News! </span></div></td>
          </tr>
          <tr> 
            <td bordercolor="#000000" bgcolor="#000000"> <div align="center"> 
                <textarea size="15" name="update" cols="80" rows="5" bgcolor="black" id="update"></textarea> ~~~This bit not showing
              </div></td>
          </tr>
          <tr> 
            <td bordercolor="#000000" bgcolor="#000000"><div align="center">
              <input name="submit" type="submit" id="submit" class="button" value="Add update">
            </div></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<? } ?><p>
<?php include_once"includes/footer.php"; ?>


</body>
</html>

 

When i go to add news it doesnt show the add news box like it should can anyone see why?

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/172009-news-script/
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.