/    Sign up×
Community /Pin to ProfileBookmark

how do i get a the pages url with php?

how do i get a the pages url with php?

i want to echo the URL of the current page at the bottom of my printer friendly pages.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@rincewind456Dec 13.2005 — Take a look at [URL=http://uk.php.net/manual/en/reserved.variables.php#reserved.variables.server]predefined variables[/URL] one of them should suit your needs.
Copy linkTweet thisAlerts:
@Bahamut-XeroauthorDec 13.2005 — exactly what i needed, forgot about those. its been a while. ^_^"

[code=php]echo '<a href="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'">';
echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'</a>';[/code]


thankyou.
×

Success!

Help @Bahamut-Xero 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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