aw crud. the ids arent working at all....here's the coding for a couple of the pages:
selkin.php
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>the garage | bands.selkin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<STYLE type=text/css>
A:link {
COLOR: #666666
}
A:visited {
COLOR: #666666
}
A:hover {
COLOR: #cccccc
}
</STYLE>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="The Garage is a network designed to give bands exposure and distribution among network points, as well as cheap studio fees for all Garage studios.">
</head>
<BODY BGCOLOR=#006699 text="#000000" link="#666666" vlink="#666666" alink="#666666" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- HEADER -->
<table width="800" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td width="800" height="141" valign="top"> <img src="../../images/thegarage.gif" alt="the garage" width="800" height="140">
<img src="../../images/divider.gif" width="100%" height="1"></td>
</tr>
<!-- NAVIGATION -->
<tr>
<td bgcolor="#0066CC" height="44">
<table width="798">
<td width="61" height="38" bgcolor="#0066CC"><a href="../../index.php"
onMouseOver="document.news.src='../../images/nav_newson.gif';" onMouseOut="document.news.src='../../images/nav_news.gif';">
<img src="../../images/nav_news.gif" width="60" height="24" name="news" border="0"></a>
</td>
<td width="76" height="38" bgcolor="#0066CC"><a href="../../about"
onMouseOver="document.about.src='../../images/nav_abouton.gif';" onMouseOut="document.about.src='../../images/nav_about.gif';">
<img src="../../images/nav_about.gif" height="24" name="about" border="0"></a>
</td>
<td width="76" height="38" bgcolor="#0066CC"><a href="../../store"
onMouseOver="document.store.src='../../images/nav_storeon.gif';" onMouseOut="document.store.src='../../images/nav_store.gif';">
<img src="../../images/nav_store.gif" name="store" border="0"></a> </td>
<td width="71" height="38" bgcolor="#0066CC"><a href="../../media"
onMouseOver="document.media.src='../../images/nav_mediaon.gif';" onMouseOut="document.media.src='../../images/nav_media.gif';">
<img src="../../images/nav_media.gif" name="media" border="0"></a> </td>
<td width="76" height="38" bgcolor="#0066CC"><a href="../../shows"
onMouseOver="document.shows.src='../../images/nav_showson.gif';" onMouseOut="document.shows.src='../../images/nav_shows.gif';">
<img src="../../images/nav_shows.gif" name="shows" border="0"></a> </td>
<td width="102" height="38" bgcolor="#0066CC"> <a href="../../contact"
onMouseOver="document.contact.src='../../images/nav_contacton.gif';" onMouseOut="document.contact.src='../../images/nav_contact.gif';">
<img src="../../images/nav_contact.gif" name="contact" border="0"></a>
</td>
<td width="66" height="38" bgcolor="#0066CC"> <a href="../../links"
onMouseOver="document.links.src='../../images/nav_linkson.gif';" onMouseOut="document.links.src='../../images/nav_links.gif';">
<img src="../../images/nav_links.gif" name="links" border="0"></a> </td>
<td width="162">
<!-- BANDS -->
<table width="162" border="0" cellpadding="4" cellspacing="2" bgcolor="#0066CC">
<tr>
<FORM name=bandselecta action=# method=post>
<TD width="150" align=left><SELECT style="WIDTH: 150px"
onchange=location.href=options[selectedIndex].value; name=iBandId>
<OPTION selected>Bands</OPTION>
<OPTION
value=http://garage.noammo.org/bands/noammo>No Ammo</OPTION>
<OPTION
value=http://garage.noammo.org/bands/selkin>Selkin</OPTION>
<OPTION
value=http://garage.noammo.org/bands/superdelightful>Super Delightful</OPTION>
<OPTION
value=http://garage.noammo.org/bands/twosamurai>The Two Samurai</OPTION>
</SELECT>
</TD></FORM>
</tr>
</table></td>
<td width="68" height="38" bgcolor="#0066CC"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- CONTENT -->
<table width="800" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" height="700">
<td width="165" height="268" bgcolor="#FFFFFF" valign="top">
<!-- RELEASES -->
<table width="140" border="0" cellpadding="4" cellspacing="2">
<tr>
<td height="32" bgcolor="#0066CC" width="150"><img src="../../images/releases.gif"></td>
</tr>
<!-- RELEASES INFO -->
<tr>
<td height="100%" bgcolor="#E9E9E9">
<table width="100%">
<tr>
<td width="100%" align="center"> <img src="../../images/albums/keeponplayin.gif" width="121" height="114"></td>
</tr>
</table>
<table>
<tr>
<td><img src="../../images/divider.gif" width="100%" height="1"></td>
</tr>
<tr>
<td width="92%"><p><font size="1" face="Verdana, Arial, Helvetica, sans-serif, Alpha Romanie Outline G98, Alpha Sentry, Volt"><strong>Selkin - Keep On Playin'</strong></font></p>
<p><font face="Arial, Arial Black, Arial Narrow"><strong><font size="1">-</font></strong><font size="1">The
first album from the alt. rock band from Ennis, Texas. From
local fan reactions, this band's album will defintely be worth
getting. </font></font></p></td>
</tr>
<tr>
<td><img src="../../images/divider.gif" width="100%" height="1"></td>
</tr>
<tr>
<td> <font size="1" face="Verdana, Arial, Helvetica, sans-serif, Alpha Romanie Outline G98, Alpha Sentry, Volt"><strong>Track
Listing: </strong></font> </td>
</tr>
<tr>
<td><img src="../../images/divider.gif" width="100%" height="1"></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">1. Hideaway </font> </td>
</tr>
<tr>
<td> <font size="1" face="Tahoma">2. Believe </font> </td>
</tr>
<tr>
<td><font size="1" face="Tahoma">3. Keep On Playin'</font></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">4. Age of End</font></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">5. In My Eyes </font> </td>
</tr>
<tr>
<td><font size="1" face="Tahoma">6. Layin' Low</font></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">7. As One</font></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">8. Memory</font></td>
</tr>
<tr>
<td><font size="1" face="Tahoma">9. Along the Way</font></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- OTHER RELEASES -->
<table width="140" border="0" cellpadding="4" cellspacing="2">
<tr>
<td height="32" bgcolor="#0066CC" width="150"><img src="../../images/otherreleases.gif" width="150" height="24"></td>
</tr>
<!-- OTHER RELEASES INFO -->
<tr>
<td height="100%" bgcolor="#E9E9E9">
<table width="100%">
<tr>
<td><font size="1" face="Tahoma">no other releases</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<!-- BAND -->
<td width="471" valign="top"> <table width="100%" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#0066CC" height="32"> <strong><img src="../../images/bandinfo.gif" width="150" height="24"></strong></td>
</tr>
<tr>
<td> <table width="100%" bgcolor="#FFFFFF">
<tr>
<td width="39%" height="215"> <p><strong><font color="#0033CC" size="+3" face="Tahoma">Selkin
</font></strong><font size="1" face="Tahoma"><strong><a href="http://www.selkin.com">[official
site]</a> </strong></font> </p>
<table width="100%">
<tr>
<td> <img src="../../images/divider.gif" width="100%" height="1"></td>
</tr>
<tr>
<td> <font size="1" face="Tahoma">Matthew Howerton - Vocals/Guitar</font></td>
</tr>
<tr>
<td> <font size="1" face="Tahoma">Kent Willis - Guitar</font></td>
</tr>
<tr>
<td height="17"> <font size="1" face="Tahoma">J.Ross Massengill
- Bass</font></td>
</tr>
<tr>
<td> <font size="1" face="Tahoma">Keelan Willis - Drums</font></td>
</tr>
</table>
<p></p></td>
<td width="61%" align="center"><img src="../../images/bands/selkin.gif" width="279" height="228"></td>
</tr>
</table>
<!-- BAND DESCRIP -->
<table width="100%" bgcolor="#FFFFFF">
<tr>
<td width="93%"> <font size="2" face="Tahoma">Selkin is a four-piece
band located in Ennis, Texas, specializing in alternative rock.
With incredible devotion to their music, this band has been
pumping out locally popular tunes and crowd-pleasers. Although
they have only played a few small shows at parties, the fan
reaction has been nothing but positive. Expect to hear more
from these guys, and their album will be the first to test out
the Garage.</font></td>
</tr>
</table>
<!-- RATINGS -->
<table width="100%" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#0066CC" height="32"><img src="../../images/ratings.gif" width="150" height="24"></td>
</tr>
</table>
<!-- USER RATINGS -->
<?PHP
$id = '1';
if ($show == "showall") {
$dbh=mysql_connect ("localhost", "francis_rate", "rate") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("francis_ratings");
$sql = "SELECT
name,
email,
rating,
comment
FROM
ratings
WHERE
id = $id
ORDER BY date DESC";
$sql_result = mysql_query($sql) or die ('Could not select data');
}
else {
$dbh=mysql_connect ("localhost", "francis_rate", "rate") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("francis_ratings");
$sql = "SELECT
name,
email,
rating,
comment
FROM
ratings
WHERE
id = $id
ORDER BY date DESC
LIMIT 5";
$sql_result = mysql_query($sql) or die ('Could not select data');
}
while ($row = mysql_fetch_row($sql_result))
{
$name= $row[0];
$email= $row[1];
$rating= $row[2];
$comment= $row[3];
$comment= nl2br($comment);
echo"<table width='100%' border='0' height='25' bgcolor='#FFFFFF' cellspacing='2'>";
echo"<tr>";
echo"<td height='5' align='left' width='100%' bgcolor='#EBEBEB'>";
echo"<table width='100%' height='14'>";
echo"<tr>";
echo"<td height='14' align='left' width='100%' bgcolor='#EBEBEB'>";
echo"<font face='Tahoma' size='2' color='#000000'><a href='mailto:$email'>$name</a></font></td>";
if ($rating == '1') {
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
}
if ($rating == '2') {
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
}
if ($rating == '3') {
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
}
if ($rating == '4') {
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
}
if ($rating == '5') {
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
echo"<td align='left' valign='top' height='14' width='25%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>";
echo "<img src='../../images/star.gif'>";
echo"</td>";
}
echo"</font></td>";
echo"</tr>";
echo"</table>";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td align='left' valign='top' height='11' width='78%' bgcolor='#EBEBEB'><font face='Tahoma' size='2' color='#000000'>$comment</font></td>";
echo"</tr>";
echo"</table>";
echo"<table width='100%'>";
echo"<tr>";
echo"<td>";
echo"<img src='../../images/divider.gif' width='100%' height='2'>";
echo"</td>";
echo"</tr>";
echo"</table>";
}
mysql_close($dbh);
?>
<!-- AVG RATING-->
<?
$numrows = mysql_num_rows($sql_result);
$ratingtotal=0;
$ratingtotal= $ratingtotal + $rating;
$averating= $ratingtotal/$numrows;
$averating = number_format($averating, 1, '.', '');
echo "<table width='100%' bgcolor='#EBEBEB'>";
echo "<tr>";
echo "<td width='100%'>";
echo "<strong><font size='1' face='Tahoma'>Average rating is $averating/5</font></strong>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<!--SHOWALL-->
<table width="100%" bgcolor="#EBEBEB">
<tr>
<td bgcolor="#EBEBEB" align="center"> <a href="?show=showall"><strong><font size="1" face="Tahoma">Show
all ratings</font></strong></a> </td>
</tr>
</table>
<!--RATE-->
<table width="100%" bgcolor="#EBEBEB">
<tr>
<td bgcolor="#EBEBEB"> <font size="2" face="Tahoma"><strong>Submit a Rating: </strong></font>
</td>
</tr>
<tr>
<td height="241" bgcolor="#EBEBEB">
<form name="rate" method="post" action="../../rateprocess.php">
<table width="100%" border="0" height="192">
<tr>
<td height="5"><div align="right"><font color="#000000" size="2" face="Tahoma">Name:</font></div></td>
<td height="5" align="left" valign="top"><input type="text" name="name" size="30"></td>
</tr>
<tr>
<td height="5"><div align="right"><font color="#000000" size="2" face="Tahoma">Email:</font></div></td>
<td height="5" align="left" valign="top"><input type="text" name="email" size="30"></td>
</tr>
<tr>
<td height="9"><div align="right"><font color="#000000" size="2" face="Tahoma">Rate:</font></div></td>
<td height="9" align="left" valign="top">
<strong><font size="2" face="Tahoma">1</font></strong><INPUT TYPE="radio" NAME="rating" value="1">
<strong><font size="2" face="Tahoma">2</font></strong><INPUT TYPE="radio" NAME="rating" value="2">
<strong><font size="2" face="Tahoma">3</font></strong><INPUT TYPE="radio" NAME="rating" value="3">
<strong><font size="2" face="Tahoma">4</font></strong><INPUT TYPE="radio" NAME="rating" value="4">
<strong><font size="2" face="Tahoma">5</font></strong><INPUT TYPE="radio" NAME="rating" value="5">
</td>
</tr>
<tr>
<td height="136" valign="top">
<div align="right"><font color="#000000" size="2" face="Tahoma">Comments:</font></div></td>
<td align="left" valign="top" height="136">
<div align="left">
<textarea name="comment" cols="40" rows="7"></textarea>
</div></td>
</tr>
</table>
<INPUT TYPE="hidden" NAME="id" value="<? echo '$id'; ?>">
<input type="submit" name="Submit" value="Submit">
</form>
</td>
</tr>
</table>
<!-- CLOSE CENTER -->
</td>
</tr>
</table></td>
<td width="162" valign="top" bgcolor="#FFFFFF">
<!-- BAND NEWS -->
<table width="100%" border="0" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td height="32" bgcolor="#0066CC" width="211"><img src="../../images/bandnews.gif"></td>
</tr>
<!-- BAND NEWS DATE/TITLE -->
<tr>
<td bgcolor="#E9E9E9"> <font size="2" face="Tahoma"><strong>Selkin:</strong></font></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#E9E9E9"> <font size="1" face="Tahoma"><strong>November
25, 2003</strong></font></td>
</tr>
<tr>
<td height="30" bgcolor="#E9E9E9">
<p><font size="2" face="Tahoma">- Selkin has just written a new song,
called "In My Eyes" See the lyrics at their site.</font></p>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#E9E9E9"> <font size="1" face="Tahoma"><strong>October 23, 2003</strong></font></td>
</tr>
<tr>
<td height="30" bgcolor="#E9E9E9">
<p><font size="2" face="Tahoma">- Selkin is planning to release
their first album between 2003 and 2004!</font></p>
</td>
</tr>
<tr>
<td bgcolor="#E9E9E9"> <font size="2" face="Tahoma">- Selkin has two
mp3's available for free download at their site.</font> </td>
</tr>
</table>
<!-- SHOWS -->
<table width="100%">
<tr>
<td bgcolor="#0066CC">
<img src="../../images/shows.gif">
</td>
</tr>
<tr>
<td bgcolor="#E9E9E9"> <font size="1" face="Tahoma"><strong>none scheduled</strong></font></td>
</tr>
<tr>
<td height="30" bgcolor="#E9E9E9">
<p><font size="2" face="Tahoma">none scheduled</font></p>
</td>
</tr>
</table>
<!-- FILLER AD -->
<table width="100%">
<tr>
<td bgcolor="#E9E9E9" width="100%"> <font size="1" face="Tahoma">ADVERTISEMENT:</font> </td>
</tr>
<td height="100" valign="middle"> <img src="../../ads/sk8.gif" width="153" height="100">
</td>
</tr>
</table>
<table width="100%" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td align="center" bgcolor="#E9E9E9"> <font size="2" face="Tahoma"><strong>SK8 THE MOVIE</strong></font>
</td>
</tr>
<tr>
<td align="center" bgcolor="#E9E9E9"> <a href="http://www.geocities.com/sk8movie/Artic/sk8orderform.html"><strong><font size="3" face="Tahoma">ORDER
IT TODAY</font></strong></a> </td>
</tr>
</table>
<!-- CONTENT END -->
</td>
</tr>
</table>
<!-- COPYRIGHT -->
<table width="800" cellspacing="0" cellpadding="0" align="center">
<tr><td width="100%">
<img src="../../images/copyright.gif" width="800">
</td></tr></table>
</body>
</html>
and rateprocess.php
PHP Code:
<?PHP
if ($id = '4') {
setcookie("alreadyrated", '$4');
}
elseif ($id = '1') {
setcookie("alreadyrated", '$1');
}
?>
<html>
<head>
<title>RATE PROCESS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#666666">
<?PHP
if ($id = '1') {
if( isset($_COOKIE['$1']) ) {
echo ("Sorry, you have already rated.<BR><BR>");
} }
elseif ($id = '4') {
if( isset($_COOKIE['$4']) ) {
echo ("Sorry, you have already rated.<BR><BR>");
}
} elseif (empty($name) || empty($email) || empty($rating) || empty($comment)) {
echo "<font face='Tahoma' size='2'>Please fill in all necessary forms.</font><BR><BR>";
} else {
$dbh=mysql_connect ("localhost", "francis_rate", "rate") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("francis_ratings");
$id=$_POST['id'];
$sql = "INSERT INTO ratings
(
name,
email,
rating,
comment,
id
) VALUES
(
'$name',
'$email',
'$rating',
'$comment',
'$id'
)";
$sql_result = mysql_query($sql,$dbh) or die ('Could not insert data.');
mysql_close($dbh);
echo "<font face='Tahoma' size='2'>Thank you for your rating.</font><BR><BR>";
}
?>
<A HREF="javascript:history.go(-1)"> <font size="2" face="Tahoma">Back</font></A>
</body>
</html>
its getting so frustrating...
after the attempt to add cookies and use ids, a few parts of the pages arent working properly. i figfured if I got the ids and cookies to work properly, then whats not working will be fixed, or it will be easier to fix them.
Bookmarks