/    Sign up×
Community /Pin to ProfileBookmark

How to a variavle for path

<?php
session_start();
$_SESSION[‘path’] = $_SERVER[‘HTTP_HOST’].$_SERVER[‘PHP_SELF’];
echo $_
SESSION[‘path’];
?>

now i have got session variable path
how can i include leftmenu.php
I’m able to do by—
<?php include”includesleftmenu.php”; ?>

I want to use $_SESSION[‘path’];
I don’t want to give path every time I want use this variable for any path please help me with code
thanks for any help???

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@PierceMooreAug 01.2009 — I am not going to lie to you, this is about the most confusing, vague thread I have seen in quite a while.

What specifically are you asking? You got the include part right..

What trouble are you having?
Copy linkTweet thisAlerts:
@JunkMaleAug 03.2009 — I think he is looking to calculate a path and then include a file leftmenu.php from the includes folder regardless of where the script is currently working from...
Copy linkTweet thisAlerts:
@PierceMooreAug 03.2009 — Ah, I see. Possibly look into basename(). ?
Copy linkTweet thisAlerts:
@MindzaiAug 03.2009 — I think he is looking to calculate a path and then include a file leftmenu.php from the includes folder regardless of where the script is currently working from...[/QUOTE]

If that's the case, just use an absolute path.
Copy linkTweet thisAlerts:
@JunkMaleAug 03.2009 — If that's the case, just use an absolute path.[/QUOTE]
Thats what I thought too but who knows what ideas the thread starter has got in mind...
Copy linkTweet thisAlerts:
@PierceMooreAug 04.2009 — Yeah, it really doesn't seem like the person who posted this thread has any interest whatsoever in actually reaching a solution for his issue.

*sigh* People, sometimes.


Pierce
Copy linkTweet thisAlerts:
@JunkMaleAug 04.2009 — *SIGH*

People... Always Ultra... as ever...
Copy linkTweet thisAlerts:
@PierceMooreAug 04.2009 — Lol @JunkMale
×

Success!

Help @Sanjay_Sirohee 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 4.29,
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,
)...