Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development
Register

Reply
 
LinkBack Thread Tools
Old 12.05.2007, 17:45   #16
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

AFAIK, there's no ordinary way to do that, but there are few workarounds available.

Ask Google about: "Browse Button CSS".

Good luck and productive research.
Reply With Quote
Old 12.05.2007, 19:19   #17
I Love BMW!
 
ExtremeSM's Avatar
 
Join Date: 11 2006
Location: reload();
Posts: 63
Downloads: 2
Uploads: 0
Reputation: 0 | 0
Default

хмм... ок сенкс, даже и не подумал чето прогуглить...

П.С.
А что значит АФАИК? О.о
Reply With Quote
Old 12.05.2007, 20:38   #18
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default

Quote:
Originally Posted by ExtremeSM View Post
хмм... ок сенкс, даже и не подумал чето прогуглить...

П.С.
А что значит АФАИК? О.о
Quote:
AFAIK - As Far As I Know - насколько мне известно
...
Reply With Quote
Old 12.05.2007, 21:22   #19
наивная дурочка
 
TasteMyLipstick's Avatar
 
Join Date: 10 2005
Location: бродяжка я
Age: 33
Posts: 196
Downloads: 0
Uploads: 0
Reputation: 25 | 3
Default

Quote:
Originally Posted by Silver View Post
Here's an (IMHO) better way of writing the same thing:

And there still are security issues I guess.
If you mean script injection, I prevented it in the following line "...&& in_array($_GET['lang'], $a_languages)" for both $_SESSION and $_GET arrays.
Reply With Quote
Old 13.05.2007, 05:00   #20
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

As I've mentioned previously, there's no need to check session vars(because like the database records, session variables and their values must be formed by the script, unlike variables coming from request), except that your code is almost unreadable, and less flexible.
Reply With Quote
Old 13.05.2007, 09:01   #21
Easy rider
 
Silver's Avatar
 
Join Date: 11 2005
Location: tristeza
Age: 32
Posts: 1,082
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Intel, my code is almost unreadable?!
Dude!!!
Reply With Quote
Old 13.05.2007, 16:27   #22
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

No, I meant her code, not yours
Reply With Quote
Old 14.05.2007, 01:13   #23
наивная дурочка
 
TasteMyLipstick's Avatar
 
Join Date: 10 2005
Location: бродяжка я
Age: 33
Posts: 196
Downloads: 0
Uploads: 0
Reputation: 25 | 3
Default

Quote:
Originally Posted by Intel View Post
As I've mentioned previously, there's no need to check session vars(because like the database records, session variables and their values must be formed by the script, unlike variables coming from request), except that your code is almost unreadable, and less flexible.
What is less flexible about my code? I'd say it's much more flexible than yours, where you used switch case operators for checking the value of every single language. I think it's not so smart to do so.
Reply With Quote
Old 14.05.2007, 08:25   #24
Easy rider
 
Silver's Avatar
 
Join Date: 11 2005
Location: tristeza
Age: 32
Posts: 1,082
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

TasteMyLipstick, switch IMHO is better than if -> elseif -> elseif -> elseif -> else.
Reply With Quote
Old 14.05.2007, 08:25   #25
Easy rider
 
Silver's Avatar
 
Join Date: 11 2005
Location: tristeza
Age: 32
Posts: 1,082
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Any code is 100% flexible if you can edit it
Reply With Quote
Old 14.05.2007, 13:32   #26
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default

Quote:
Originally Posted by TasteMyLipstick View Post
What is less flexible about my code?
Theoretically, for example you can't control, if the $_GET['lang'] is defined, or not. You may only surmise, starting from isset($_GET['lang']) conjunct with in_array($_GET['lang'], $a_languages).
Quote:
Originally Posted by TasteMyLipstick View Post
I'd say it's much more flexible than yours, where you used switch case operators for checking the value of every single language. I think it's not so smart to do so.
Well, it's not a big deal, I think. Assuming that:
First of all, the count of languages is finite, and in handsome majority of cases not greater than 2 or 3. So probably our switch structure will not grow up so much.
Secoundly, you may perform custom actions different for each language.

In addition:
Your code contains useless assignings, checks, script termination, also it outputs HTML code(which, I suppose, is very rough for back-end layer) ...
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 21:39.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.