/    Sign up×
Community /Pin to ProfileBookmark

Includes and absolute urls?

On my site, [url]http://projep.t35.com/[/url] , I have a PHP script that changes the style. What I want to do on the php file in the “action=” attribute, is for it to
1. include the code for a php file,
2. include an echo saying ‘your style has been set
3. include the page that the visitor was last on
4. include the yet another php file.

i’ve succeeded in 1, 2, and 4. I don’t know how to do 3. i tried using

[code=php]include $_SERVER[“HTTP_REFERER”];[/code]

. it makes me think that php has an issue with absolute urls. can anyone help, or is there another variable i could use? ive heard of something called parse_url or whatever but i dont no how to use it.

if u need the source, just ask.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Daot_LagorilleFeb 19.2004 — Sometimes what I do to make things simple is declare a variable and set the value to the filename of the page it is one, i.e.
[code=php]$varCurrentpage == "filename.php"[/code]

You can just pass this in form.

Then again, not knowing what you want to do, this may be entirely ridiculous. I don't know.
Copy linkTweet thisAlerts:
@Ben_RogersauthorFeb 19.2004 — i need a universal variable for the pagge, because i use includes and variables so most of my pages are sumtin like http://projep.t35.com/a.php?a=contact .

if i had a universal variable for the pages own url itd be much easier... totally lost right now ?
×

Success!

Help @Ben_Rogers 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.20,
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,
)...