By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

partitioning the program depending upon browser

P: n/a
Hallo,

I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.

Here am asking that how to compatible the total code depending upon
the browsers used by users.

if you know any thing please mail me to ra*******@gmail.com

thanking you,

Best Regards,
Rajasekhar.

Apr 19 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"rajasekhar" <ra*******@gmail.comwrote in message
news:11**********************@b58g2000hsg.googlegr oups.com...
Hallo,

I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.

Here am asking that how to compatible the total code depending upon
the browsers used by users.
echo $_SERVER['HTTP_USER_AGENT'];

if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)){

// code for firefox

} else if ( .....

Also you should know that some browsers can send a different useragent
string than what the actually are. Opera for example can pretend to be IE.
So it can't be trusted 100%, it's only about 95% accurate. (95% is based on
a personal guess, not on an actual reserch..)
if you know any thing please mail me to ra*******@gmail.com
Sorry, but I'm replying to the group. This is the way usenet works.

--
Ra*********@gmail.com

"Good tea. Nice house." -- Worf
Apr 19 '07 #2

P: n/a
rajasekhar wrote:
Hallo,

I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.

Here am asking that how to compatible the total code depending upon
the browsers used by users.

if you know any thing please mail me to ra*******@gmail.com

thanking you,

Best Regards,
Rajasekhar.
Why would you ever want to duplicate effort like that? Serving
different html to different browsers is a great way to get your site
banned from the search engines. Oh well, it's your site which gets banned.

$_SERVER['HTTP_USER_AGENT'] will tell you what the browser claims it is.
But there's no way to tell for sure what the browser really is.

And this is usenet. Ask a question on usenet, get a response in usenet.
That's how it works.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 19 '07 #3

P: n/a
On Apr 19, 2:59 pm, "Rami Elomaa" <rami.elo...@gmail.comwrote:
"rajasekhar" <rajaja...@gmail.comwrote in message

news:11**********************@b58g2000hsg.googlegr oups.com...
Hallo,
I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.
Here am asking that how to compatible the total code depending upon
the browsers used by users.

echo $_SERVER['HTTP_USER_AGENT'];

if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)){

// code for firefox

} else if ( .....

Also you should know that some browsers can send a different useragent
string than what the actually are. Opera for example can pretend to be IE.
So it can't be trusted 100%, it's only about 95% accurate. (95% is based on
a personal guess, not on an actual reserch..)
if you know any thing please mail me to rajaja...@gmail.com

Sorry, but I'm replying to the group. This is the way usenet works.

--
Rami.Elo...@gmail.com

"Good tea. Nice house." -- Worf
thanks for the reply.

Rajasekhar.

Apr 19 '07 #4

P: n/a
rajasekhar <ra*******@gmail.comwrote in news:1176986847.567106.158540
@b58g2000hsg.googlegroups.com:
Hallo,

I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.
you are creating long-term maintenance pain for yourself and anyone else
who might be involved!!!

Apr 20 '07 #5

P: n/a
On Thu, 19 Apr 2007 21:13:36 -0500, Good Man wrote:
rajasekhar <ra*******@gmail.comwrote in news:1176986847.567106.158540
@b58g2000hsg.googlegroups.com:
>I am developing a site, and here whats the problem is: how to
partition the code, i.e. if I developed 1000 lines of code, in that I
want to show first 200 lines only if the user opens my website using
IE, and next 200 lines in Firefox, and remaining lines in another
browsers.

you are creating long-term maintenance pain for yourself and anyone else
who might be involved!!!
And, pray tell, how will you know for certain that I am visiting your
web site and using konqueror, or opera, or lynx, or firefox, or
internet expoloder?

Apr 20 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.