|
Posted by James54321 on 10/22/06 18:21
Firstly WOW thank you for both responding so quickly and secondly here
is my code:
<?php
include('../config.php');
//include('../head.php');
echo("<body bgcolor=\"lightblue\">");
echo("<title>approval</title>");
//include('links.php');
function displayIdeas($result)
{
echo("<form method=\"post\">");
print "\n<table border=\"1\">\n<tr>\n" .
"\n\t<th>Approve</th>" .
"\n\t<th>Delete</th>" .
"\n\t<th>Ban</th>" .
"\n\t<th>Idea ID</th>" .
"\n\t<th>Idea Name</th>" .
"\n\t<th>Category</th>" .
"\n\t<th>Idea</th>" .
"\n\t<th>Time Submitted</th>" .
"\n\t<th>Date Submitted</th>" .
"\n\t<th>User</th>" .
"\n\t<th>IP Address</th>" .
"\n</tr>";
while($row = mysql_fetch_row($result)) {
list($ID,$Idea_Name,$Category,$Idea,$Time,$Date,$User,$IP_Address) =
$row;
{
if ($rowcounter == '1') {
print "\n<tr bgcolor=\"yellow\">";
$rowcounter = '2';
} else {
print "\n<tr bgcolor=\"lightblue\">";
$rowcounter = '1';
}
print "\n\t<td><center><input type=\"radio\" name=\"$ID\"
value=\"Approve\" /></center></td>";
print "\n\t<td><center><input type=\"radio\" name=\"$ID\"
value=\"Delete\" /></center></td>";
print "\n\t<td><center><input type=\"radio\" name=\"$ID\"
value=\"Ban\" /></center></td>";
foreach($row as $data)
print "\n\t<td> {$data} </td>";
print "\n</tr>";
}
}
print "\n</table>\n";
echo("<input type=\"submit\" name=\"submit\"
value=\"Go\"></td></form>");
}
$query = "SELECT ID,Idea_Name,Category,Idea,Time,Date,User,IP_Address
FROM ideas WHERE Approved = 0 AND Category != 'ADMIN' Order by 'id'
ASC";
if (!($conn = @ mysql_connect($host,$user,$pass)))
die("Cannot Connect");
if (!(mysql_select_db($db,$conn)))
showerror();
if(!($result = @ mysql_query ($query)))
showerror();
displayIdeas($result);
mysql_close($conn);
if (isset($_POST['submit'])) {
//this is where the code i need should go :)
// close connection
mysql_close($connection);
}
?>
Navigation:
[Reply to this message]
|