[PHP] Adding Querystrings to links

2002-04-08 Thread mail

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=12item=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



RE: [PHP] Adding Querystrings to links

2002-04-08 Thread Rance Hall

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 tda 
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=12item=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




Re: [PHP] Adding Querystrings to links

2002-04-08 Thread Erik Price


On Monday, April 8, 2002, at 11:12  AM, [EMAIL PROTECTED] wrote:

 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=12item=2
 The variables ?dest= and item= should be in every Link on my
 site.But only the values 12 and 2 should be alterable.

Here is an example:

$destination = 12;
$item = 12;

// later in the script

print(a 
href=\http://domain.com/index.php?dest=$destinationitem=$item\;Link/a
);




Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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