you want to try a code line like this

print "<a 
href=\"yourpagehere.phtml?dest=$line[index]&item=$line[index2]\">LinkName</a>";

it will only work of course if you are in the middle of a loop that processes the 
results of an appropriate select statement that pulls the needed values for your dest 
and item variables.

for a similar project I wrote this:

for ($i=0; $i < $rowcount; $i++) {
        $line = mysql_fetch_array($results);
        if ($i % 2) {
                 print "<tr bgcolor=\"white\">\n";
                }
        else {
                 print "<tr bgcolor=\"#e0e0e0\">\n";
                }
         print "<td><a 
href=\"project_details.phtml?project=$line[pk]\">$line[projectname]</a></td>\n";
         print "<td>$line[projectcustomer]</td>\n";
         print "<td>$line[projectstatus]</td>\n";
         print "<td>$line[projectcompletion]%</td>\n";
         print "</tr>\n";
         }


Hope it helps


Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Adding Querystrings to links


Hi all!

I have a problem with the querystring.I want to add to every Link on my Homepage a 
querystring, but i should have the possibility to change some details in the 
Querystring.
How should i solve this problem ?

Example :

http://domain.com/index.php?dest=12&item=2
The variables "?dest=" and "&item=" should be in every Link on my site.But only the 
values "12" and "2" should be alterable.

Thank you,and sorry for my bad english
Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to