Hi all,
I have a page named choice.php, which displays a dropdown filled with categories, (A-Z), which lets the user choose a category.
In the categories are artists which get displayed depending on which category they reside, and which category the user chooses.
These get displayed using view.php. EG...(http://www.dsfghrt.com/view.php?id=1). Category A is number 1 in database, B=2, c=3, and so on.
What i wish to know is how can i make each artist name into a link, which will then display the rest of the info on another page.
This info is also in the database under artist_name, album_name and album_info.
Thanks all,
Steve
BTW...Here is the code for choice.php and view.php
Choice.php
<?php require('Connections/xxx.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form action="view.php" method="GET">
<div align="center">
<select name="category">
<option>Browse Category</option>
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
<option value="4">D</option>
<option value="5">E</option>
<option value="6">F</option>
<option value="7">G</option>
<option value="8">H</option>
<option value="9">I</option>
<option value="10">J</option>
<option value="11">K</option>
<option value="12">L</option>
<option value="13">M</option>
<option value="14">N</option>
<option value="15">O</option>
<option value="16">P</option>
<option value="17">Q</option>
<option value="18">R</option>
<option value="19">S</option>
<option value="20">T</option>
<option value="21">U</option>
<option value="22">V</option>
<option value="23">W</option>
<option value="24">X</option>
<option value="25">Y</option>
<option value="26">Z</option>
</select>
<input type="submit">
</div>
</form>
</body>
</html>
View.php
<?php require('Connections/xxx.php'); ?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['category'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['category'] : addslashes($_GET['category']);
}
mysql_select_db($database_xxxdb, $xxxdb);
$query_Recordset1 = sprintf("SELECT id, artist_name, album_title, category FROM upload2 WHERE category = '%s' ORDER BY artist_name DESC", $colname_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $xxxdb) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<link href="/standard.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style10 {
font-size: 14;
color: #999933;
}
-->
</style>
<title>xxx - Search Results</title><p> </p>
<div align="center" class="style1 style10">
<p><?php echo $totalRows_Recordset1 ?> Category Result Found<br>
</p>
</div>
<table width="383" border="0" align="center" cellpadding="8" cellspacing="5">
<tr>
<td><div align="center" class="style5">Artist / Group </div></td>
<td><div align="center" class="style5">Album Title </div></td>
</tr>
<?php do { ?>
<tr>
<td class="style6"><div align="center"><?php echo $row_Recordset1['artist_name']; ?>
</div></td>
<td class="style6"><div align="center"><?php echo $row_Recordset1['album_title']; ?></div></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php
mysql_free_result($Recordset1);
?>