/    Sign up×
Community /Pin to ProfileBookmark

making clean urls using PHP ??

Hello forums !!
I am bored with working with the url with query string urls ie(“http://localhost/my_project/index.php?page=test&action=create“).
Now i would like to work with clean urls like “http://localhost/my_project/test/create
I would like to rewrite the url without using mod_rewrite module rather i would like to use PHP.
How to explode the urls to get the required parameters ?
Note: I am working under the my_project folder
Any comments n suggestions are warmly welcome.
Thanks in advance to all of you.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guySep 04.2007 — How to [B]explode[/B] the urls to get the required parameters ?[/quote]$var = explode("/",$_SERVER["PHP_SELF"]);
Copy linkTweet thisAlerts:
@PHPychoauthorSep 04.2007 — how to enable $_SERVER['PATH_INFO'], it says undefined index PATH_INFO.
Copy linkTweet thisAlerts:
@flannSep 04.2007 — 
Note: As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined.

Apache 2 users may use AcceptPathInfo = On inside httpd.conf to define PATH_INFO.
[/quote]


source: http://us3.php.net/reserved.variables
×

Success!

Help @PHPycho 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.19,
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,
)...