hello frnd. how to short a browser in script Mobile chat wml ? help me guys. i need ur help huys. give me the code.
Pls help me , how to Short browser
Collapse
X
-
Originally posted by weet2012 View Posti want 15 maxlength browser . i've no idea if users joined use 100 letters in the browser. pls give me the code bro ...
Or try this,
PHP Code:$browser = $_SERVER['HTTP_USER_AGENT'];
$browser = substr($browser, 0, 15); // will return the first 15 characters from the browser
// then do your stuff here
I'm Proud to be a Sri Lankan!
Comment
-
Originally posted by weet2012 View Postwhere im holding the code bro ?
I'm Proud to be a Sri Lankan!
Comment
-
i dont know what your trying to accomplish. but it makes no sense what so ever.
my script already cuts down the browser name to names like.
PHP Code:$user = explode ('/', $_SERVER['HTTP_USER_AGENT']);
echo $user[0];
mozilla
chrome
safari
etc etc.
and the users themselfs cannot modify the outcome of this result.
so i see this as a futial attempt at coding something that doesnt need fixing.
but each to their own.<?php
include ('Ghost');
if ($Post == true) {
echo '
sigpic
alt='coding-talk.com!!' />';
echo 'Sharing Is Caring!';
} else {
echo '
alt='the username GHOST has been comprimised!' />';
echo 'OMG SOMEBODY HELP ME!!';
}
?>
Comment
-
well ive never come across a situation where the user has been able to modify the outcome of what his browser name displays at, but ill take your word for it.
and your solution would be to do what?<?php
include ('Ghost');
if ($Post == true) {
echo '
sigpic
alt='coding-talk.com!!' />';
echo 'Sharing Is Caring!';
} else {
echo '
alt='the username GHOST has been comprimised!' />';
echo 'OMG SOMEBODY HELP ME!!';
}
?>
Comment
-
well thats given me something to think about at least.
although that snippet seems like alot of work just to grab a browser name and dump it into a .txt file.
wether its a temp dump or a permenent one.
but thanks though.<?php
include ('Ghost');
if ($Post == true) {
echo '
sigpic
alt='coding-talk.com!!' />';
echo 'Sharing Is Caring!';
} else {
echo '
alt='the username GHOST has been comprimised!' />';
echo 'OMG SOMEBODY HELP ME!!';
}
?>
Comment
-
Welcome. ;) But i think that everything less than that is meaningless, for it structure as it covers check for empty server var, it can be isset but with no value, and sets the word Browser if is, checks if there is / slash and if not sends it to check and cut if its longer that 10 chars, if is / slash there it goes to see what there is, as for browser reading many of phones is gonna display Mozilla even when it totally different models, not to mention manufactors, here is covered Nokia phones not to display Mozilla when its Nokia or if in first string is model to display, for example, NokiaN97, not Nokia. Similar goes for IEMobile and Android...
So, that function can only be extended, and plus better over strstr() as it uses strpos() is faster and clearly faster than regex and preg_match(). ;)<!DOCTYPE html PUBLIC "-//WAPFORUM.RS
Comment
-
Well...Actually browser is a user input as I see....and of course user can change the browser name showing...there are many proxies which can do that..
I think it is better to use explode function like this.
PHP Code:$user = explode (" ", $_SERVER['HTTP_USER_AGENT']);
I'm Proud to be a Sri Lankan!
Comment
Comment