problems with links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toplet159
Forum Newbie
Posts: 10
Joined: Sun Jul 11, 2004 1:20 pm

problems with links

Post by toplet159 »

HI, i have a problem, i need to be able to change the links according to what $type is
e.g if type was slr i would need the links to change to page?type=slr&srt=price
at the moment they would remain to be page?type=digital&srt=price
help much appreciated thanks

Code: Select all

<?php echo "<table width="960" class="dbtbl" cellpadding="0" cellspacing="0">";
	$srt = $_GET['srt'];
		$type = $_GET['type'];
	$result = mysql_query("SELECT * FROM prod where prodType LIKE '$type' ORDER BY '$srt' ASC") or die(mysql_error()); 
$num_rows = mysql_num_rows($result);
for ($i = $i; $i <= $num_rows; $i++) {
while ($u = mysql_fetch_array($result)) {
extract($u);
 $f_price = number_format($price,2);
echo"<tr class="menuright">\n
               <td width="100"><center><img src="$pic"></center></td>\n
		   <td width="130" ><center>$prodType<a href="{$_SERVER['SCRIPT_NAME']}?srt=prodType"prodtype</a>></center></td>\n
		   <td width="130" ><center>$manufacturer<a href="{$_SERVER['SCRIPT_NAME']}?srt=manufacturer">manufacturer</a></center></td>\n
		   <td width="150" ><center>$prodName<a href="{$_SERVER['SCRIPT_NAME']}?type=digital&srt=prodName">prodname</a></center></td>\n
		   <td width="250" ><center>$prodDescription</td>\n
           <td width="100" ><center>£$f_price<a href="{$_SERVER['SCRIPT_NAME']}?type=digital&srt=price">price</a></center></td>\n
		   <td width="100" ><center>$stock</center></td>\n
           </tr>\n";
*sorry forgot to put in problem :p*
Last edited by toplet159 on Sat Aug 07, 2004 11:57 am, edited 1 time in total.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

And your exact problem put into description is?
Post Reply