Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-07-2004, 12:59 PM problems with links
Novice Talker

Posts: 5
Trades: 0
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

PHP Code:
<?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"
;

Last edited by toplet; 08-07-2004 at 01:58 PM..
toplet is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-07-2004, 06:17 PM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
PHP Code:
<?php
$type 
"slr";
echo 
"<a href=\"hello.php?type=$type\">Link I am</a>";
?>
is that what you mean?
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Reply     « Reply to problems with links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12835 seconds with 12 queries