how carry variable to 2 different pages with one click?

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
paul_20k
Forum Commoner
Posts: 45
Joined: Fri Nov 10, 2006 7:02 pm

how carry variable to 2 different pages with one click?

Post by paul_20k »

Hi

I have lots of links on my home page. When I click on that links, it carries the variable value to another page by passing variable by url like

Code: Select all

<a target="Content" STYLE="text-decoration:none" href="xyz.php?act1=PPP"><font face='Verdana' size='3' color=#FFFFFF><small>PPP</small></font></a>
I want to pass this variable value "PPP" to another page at the same time also ie with only one click like if I have another page called "abc.php", I want to use that variable value "PPP" on page "xyz.php"(as shown in my code) and "abc.php" at the same time.

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not use a session variable to pass the data around?
paul_20k
Forum Commoner
Posts: 45
Joined: Fri Nov 10, 2006 7:02 pm

Post by paul_20k »

hi

I tried with sessions but I want to attach the particular variable value to that particular link , like if I have link

Code: Select all


<a target="Content" STYLE="text-decoration:none" href="xyz.php?act1=PPP"><font face='Verdana' size='3' color=#FFFFFF><small>PPP</small></font></a>

<a target="Content" STYLE="text-decoration:none" href="xyz.php?act2=QQQ"><font face='Verdana' size='3' color=#FFFFFF><small>QQQ</small></font></a>

and so on. I have like 25 such links. I can carry these variable values to page "xyz.php" and its working fine. I just want to carry these same values(like variables act1, act2, .......etc) in the same style to another page like "abc.php".

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Attach the variable again to those links?
paul_20k
Forum Commoner
Posts: 45
Joined: Fri Nov 10, 2006 7:02 pm

Post by paul_20k »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi

   you mean like 

[syntax="html"]<a target="Content" STYLE="text-decoration:none" href="xyz.php?act1=PPP", "abc.php?act1=PPP"><><font face='Verdana' size='3' color=#FFFFFF><small>PPP</small></font></a>
thanks


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The browser cannot request two pages for the same page. The latter request will often be used. Although your posted syntax won't even attempt to request two pages.
paul_20k
Forum Commoner
Posts: 45
Joined: Fri Nov 10, 2006 7:02 pm

Post by paul_20k »

hi
The latter request will often be used.
which later request is often used? The one which I sent in my last message? but its not working at all. If I can't request 2 pages , then how can I get the variable value on the other page ie abc.php with one click??

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Latter, as in the last request made by the user of the browser. If one clicks a link then clicks a different link before the page has changed the second link will more often then not be take priority to follow by the browser.

Your site design may need some revision if you need two pages requested with a single click. For example, one page could incorporate the other via include().
paul_20k
Forum Commoner
Posts: 45
Joined: Fri Nov 10, 2006 7:02 pm

Post by paul_20k »

thanks
Post Reply