/    Sign up×
Community /Pin to ProfileBookmark

Pass parameter with anchor tag

Hi all,
I am developing a PHP application. I want to do this, I have a link. when the user clicks the link a page (for eg. lets have this page name as #2) should be displayed. The contents of the page #2 is dependent on a variable in Page 1(where the link reside). I want to pass this variable along with the anchor tag i.e link. How can I do this?

Please help. Any help is appreciated.

Thanks,

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@the_treeAug 16.2005 — You could just generate GET values.[code=php]echo "<a href="page2.php?=$variable">Link</a>";[/code]
Copy linkTweet thisAlerts:
@mysujaauthorAug 16.2005 — Does that variable needs to be global?

In my Page#2 if I try to use it like

echo $variable;

I am not getting anything?. What am I doing wrong.
Copy linkTweet thisAlerts:
@spufiAug 16.2005 — if (isset($_GET['variable'])) {

echo $_
GET['variable'];

}

For future refernce, this type of question should be posted in the PHP section.
×

Success!

Help @mysuja spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...