Forum Moderators: coopster
source code:
<form metho="post" action="updater.php">
<table width='600' border='0' cellspacing='1' cellpadding='2'>
<tr align='center' bgcolor='#CCCCCC'>
<td align='left'><b>HEADLINE</b></td>
<td><b>CATEGORY</b></td>
<td><b>STATUS</b></td>
<td><b>ARCHIVE?</b></td>
<td><b>MAKE ACTIVE?</b></td>
</tr>
<?
[databse,username,password stuff goes here]
$query="SELECT * FROM database WHERE active!='o' order by cat ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$pig=white;
while ($row = mysql_fetch_array($result)) {
$headline=mysql_result($result,$i,"headline");
$story=mysql_result($result,$i,"story");
$id=mysql_result($result,$i,"id");
$status=mysql_result($result,$i,"active");
$caty=mysql_result($result,$i,"cat");
$tidbit=substr($story,0,50);
if ($pig!='white')
{
$pig=white;
}
else {$pig='eeeeee';}
?>
<tr align='center' bgcolor=<? echo "$pig"; ?>>
<td align='left'><? echo"<a href='news_edit.php?id=$id'>$headline</a>"; ?></td>
<td>
<?
switch($caty)
{
case "b" :
echo "BUSINESS";
break;
case "n" :
echo "NEWS";
break;
case "v" :
echo "VIEWPOINT";
break;
}
?>
</td>
<td>
<?
if ($status=="a")
{
echo "ACTIVE";
}
else
{
echo "DEAD";
}
?>
</td>
<td>
<?
echo "<input type='radio' name='f_active[{$row[id]}]' value='o'>";
?>
</td>
<td>
<?
echo "<input type='radio' name='f_active[{$row[id]}]' value='a'>";
echo "<input type='hidden' name='oldactive[{$row[id]}]' value='{$row[active]}'";
?>
</td>
<?
++$i;
}
?>
</tr>
</table>
<p>
<input type="submit" name="subarch" value="Submit">
<input type="reset" name="reset" value="Reset">
</p>
</form>
as I said never had any probs before- nothing has changed cept I'm using a PC