/    Sign up×
Community /Pin to ProfileBookmark

possible to do a get query on dir name?

Is it possible to query a database based on the name of the directory? So if for example i have the directory account at website.com/account, would it be possible to have a get query on the index page which gets ‘account’ and queries the database with ‘account’

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachJun 26.2006 — You can use $_SERVER['REQUEST_URI'] for that. So when you have your

website.com/account

Then you could do

[code=php]
$dir_a = explode('/',$_SERVER['REQUEST_URI']);
$dir = $dir_a[1];
[/code]


so $dir would be in this case 'account'

There are probably better way to do it but i think this would work
Copy linkTweet thisAlerts:
@MegatronauthorJun 27.2006 — cheers, thanks for the info
×

Success!

Help @Megatron 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.18,
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,
)...