/    Sign up×
Community /Pin to ProfileBookmark

url if condition

Hello

I wonder how i can run a piece of php code only if my url is [url]http://mypage.com/[/url] if it is [url]http://mypage.com/2[/url] it should not run and so on.

hope someone can help.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Aug 17.2010 — http://mypage.com/2 is completely different to http://mypage.com. The former refers to a specific file, the latter refers to index.something most likely. You can [url=http://www.invision-graphics.com/HTML_Guide-16.html]change the default file[/url] too.
Copy linkTweet thisAlerts:
@tirnaAug 18.2010 — myPage.com/2 is referring to a specific folder on your website at myPage.com

Therefore, all you would need to do is add the page specific code to the default web page file in myPage.com/2
×

Success!

Help @evania 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 7.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ,
analytics: Fullres
});

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: Anonymous,
tipped: article
amount: 1000 SATS,

tipper: Anonymous,
tipped: article
amount: 1000 SATS,

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