<?
$connection = @mysql_connect("localhost", "cooperce_poll", "hermie") or die("Couldn't connect.");
$db = @mysql_select_db(cooperce_poll, $connection) or die("Couldn't select database.");
$sql = "SELECT *
FROM topics
ORDER BY id DESC
";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
$contact_list = "<ul>";
while ($row = mysql_fetch_array($result)) {
$id5 = $row['id'];
$topic5 = $row['topic'];
$date5 = $row['date'];
$contact_list .= "<li><a href=\"old_opinions.php?theID=$id5\">$topic5</a> -- $date5";
}
$contact_list .= "</ul>";
?>
<?
include("connect.php");
$sql2 = "SELECT * FROM topics ORDER BY id";
$query2 = mysql_query($sql2) or die("Cannot query the database.<br>
" . mysql_error());
while($result2 = mysql_fetch_array($query2)) {
$topic = stripslashes($result2["topic"]);
$tid = stripslashes($result2["id"]);
$date = stripslashes($result2["date"]);
$display_past = "<ul>";
$display_past .= "<li><a href=old_opinions.php?id=$tid>$topic</a> -- $date</li>";
$display_past .= "</ul>";
}
$sql_count = "SELECT count(oid) FROM opinions WHERE id = \"$tid\"";
$result_count = @mysql_query($sql_count) or die("Couldn't execute query.");
$count = mysql_result($result_count,0,"count(oid)");
?>
<p><a href="http://www.coopercentral.org"><img src="images/cclogo.gif" width="222" height="132"></a></p>
<body link="#0000FF" vlink="#800080" alink="#FF0000" text="#000000" bgcolor="#FFFFF0">
<table border=1>
<tr>
<td bgcolor="#C7DFFC" valign="top">
<?php
$title = "Give us your Opinion! - $count so far!";
$titlecolor = "800000";
$titlefont = "/home/cooperce/public_html/fonts/COMIC.ttf";
$titlesize = "24";
$rotation = "90";
echo "<IMG SRC=\"/includes/graftext.php?title=$title&titlecolor=$titlecolor&titlefont=$titlefont&titlesize=$titlesize&rotation=$rotation\" ALT=\"$title\">";
?><td valign="top">Write a <b><i>brief</i></b> opinion of the topic below.
<table border=1>
<tr>
<td bgcolor=#CCFFB1 align=center><font size=4><b><? echo $topic; ?></b></font> </td>
</tr>
<tr>
<td>
<form method=POST action=<?php echo $PHP_SELF; ?>>
<p><input type=text name=text size=100 maxlength=225><input type=submit value=Post!></p>
</form>
</td>
</tr><td>
<?php
include("connect.php");
$today = date("M j, Y, h:i");
if(!empty($text)) {
$text = addslashes($text);
$sql = "INSERT INTO opinions SET oid='', id='$tid', opinion='$text', date='$today'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
$text=NULL;
$oid=NULL;
$id=NULL;
$date=NULL;
$today=NULL;
} else {
}
$sql3 = "SELECT * FROM opinions WHERE id = \"$tid\" ORDER BY oid DESC";
$query3 = mysql_query($sql3) or die("Cannot query the database.<br>" . mysql_error());
while($result3 = mysql_fetch_array($query3)) {
$opinion = stripslashes($result3["opinion"]);
$today5 = stripslashes($result3["date"]);
echo "
<font size=2>$opinion</font> <font size=1>-- <b>$today5</b><hr></font>
";
}
?>
</td>
</tr>
</hr>
</table>
</table>
<p></p>
<h2>Past Opinions</h2>
<p><?php echo "$contact_list"; ?></p>
<p></p>
<p align="right"> </p>
<p align="right"><a href="http://www.coopercentral.org">Coopercentral.org</a>
2002<br>
Email me: <a href="mailto:Kenny@coopercentral.org">Kenneth L. Cooper III</a><br>
<a href="privacy.php">Coopercentral Privacy Policy</a></p>