![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Web Development Java/PHP/Perl/ASP and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | |
| I Love BMW! Join Date: Nov 2006 Location: reload();
Posts: 63
Rep Power: 0 Reputation:
10 | <?php session_start(); $lang = $_SESSION["lang"]; if (!$lang) {$lang = $_GET['lang'];} if ($lang == "ru") { require("./data/languages/ru.php"); $_SESSION["lang"] = "ru"; }else{ require("./data/languages/en.php"); $_SESSION["lang"] = "en"; } ?> joxovurt jan ogneq eli, esor inch vor uxexs anjatvaca chem jogum vonc karelia dzel? uzum em vor skzbic nayi lang ete ka session-i mech stana "ru"-a te "en", ete chka session-i mech get methodov vekali arjeq@ lang-i u gri session-i mej vor myus ejerum mna et en-@ kam ru-n... hima problems nranuma, vor mi angam inq@ mtav get metodov vekalec asenq ru arjeq@, grec sessioni mej, baic heto vor grum em ?lang=en arden chi poxum, mnuma hin session@ =\ vonc karelia dzel?
__________________ http://megauploader.net/ ------ new designed, new engine powered now still free, fast and without registration...
|
| | |
| | #17 |
| I Love BMW! Join Date: Nov 2006 Location: reload();
Posts: 63
Rep Power: 0 Reputation:
10 | хмм... ок сенкс, даже и не подумал чето прогуглить... П.С. А что значит АФАИК? О.о
__________________ http://megauploader.net/ ------ new designed, new engine powered now still free, fast and without registration...
|
| | |
| | #18 | ||
| йес эм эли... | Quote:
Quote:
![]()
__________________ իմ լաստը | իմ ֆկանտակտը | իմ տունը | ես.սեքսի.եմ --- www.imagger.com - Free Image Hosting System www.armblogs.info, www.file.am, www.imageshare.am, www.softportal.am, www.marshrut.info | ||
| | |
| | #19 |
| наивная дурочка | If you mean script injection, I prevented it in the following line "...&& in_array($_GET['lang'], $a_languages)" for both $_SESSION and $_GET arrays.
__________________ Я поняла, любовь - страна, Где каждый человек - притворщик. |
| | |
| | #20 |
| Дошкольник | 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. |
| | |
| | #23 | |
| наивная дурочка | Quote:
__________________ Я поняла, любовь - страна, Где каждый человек - притворщик. | |
| | |
| | #26 | |
| Дошкольник | 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:
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) ... ![]() | |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NHibernate: Problem with Configuration | Intel | Languages, Compilers and Interpreters | 0 | Mar 4, 2007 07:49 |
| Georgiy Marganatis - No Problem!!! | Rub | MusiCity | 0 | Nov 9, 2006 23:27 |
| PROBLEM: Unicode URLs | Silver | Web Development | 1 | Feb 27, 2006 05:42 |
| Internet Problem !!! | KarenN | Software | 2 | Dec 22, 2005 10:46 |
| Dial-up yahoo-mail access problem | Tropical | General | 1 | Nov 12, 2005 21:22 |