/    Sign up×
Community /Pin to ProfileBookmark

What does this do ?

<a href=’$PHP_SELF?topicid=$topicid&page=$pagenext’>

if I and running prog.php

1)
when i click on this link will it re-run it?

2)
the value seems to have two parts
is the & in it just part of the variable name
or is it an opperand ?

$topicid&page does it mean $topicid & page ?

I’d like to understand this bit of code !!

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 03.2005 — More robustly written as...
[code=php]
echo "<a href='{$_SERVER['PHP_SELF']}?topicid=$topicid&page=$pagenext'>";
[/code]

...this links to the current page, and it includes two "get" method variable names and values. So if the user clicks on this link, they'll go to the same page they are already on, but this time there will be two $_GET variables set and available for use in your script: $_GET['topicid'] set to the value of $topicid and $_GET['page'] set to the value of $pagenext.
×

Success!

Help @DaveinLondon 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.15,
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,
)...