/    Sign up×
Community /Pin to ProfileBookmark

Putting link text into a variable?

Heya.
I was wondering if it’s possible to get the text of a link and put it into a variable? for example:

[code]<a href=”next.php”>linky</a>[/code]

I’d eventually like to put the variable (linky) into a hidden form variable on the ‘next.php’… I’m not sure if there’s a way for PHP to see what text was clicked to get to next.php.
I know google does something like this with it’s pagerank system, but it may be too complicated to explain here… anyone have any ideas/know-how?

Thanks ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pyroFeb 04.2004 — You'd probably have to pass it along with the link, if I understand you correctly.

<a href="next.php?text=linky">linky</a>
Copy linkTweet thisAlerts:
@hammerslaneauthorFeb 04.2004 — ah yes, that's what i thought i'd have to do.... it's just i have an absolute shed-load of links. there are like 200 links on a page, and rather passing through the variables like this:
&lt;a href="next.php?text=linky1"&gt;linky1&lt;/a&gt;
&lt;a href="next.php?text=linky2"&gt;linky2&lt;/a&gt;
&lt;a href="next.php?text=linky3"&gt;linky3&lt;/a&gt;
...If there's no way to dynamically pass the variable through, I guess I'll have to give the copy and paste a bit of exercise :p

thanks pyro ?

[i]ps: also pyro, can you check your pm's?[/i]
×

Success!

Help @hammerslane 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...