Language Session
I maintain a site, whose main language is german, but I want to provide an international version in english too. I thought of putting a language choice on the entrypage and directing all requests for the english pages to an subfolder (e.g. root/en/).
The problem now is, that there is an guestbook script, which then is used by german-speaking and english-speaking visitors, and I want the english visitors return from the guestbook to the english pages and all others to the german ones.
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Session - Change The Language Of The Site
1 frame in top where I have some images to change the language of the site if clicked - 1 frame at left for the menu - 1 frame at middle to load the page chosen in menu in the index.php my code is (i save in a var the name of the page displayed and the language active) Code:
View Replies !
View Related
Session Problem: Session Exists, But Session Variables Don't Lasts
I have some troubles with session variables. I can easily create a session, but the variable I append to global session array ( $_SESSION) lasts only until the end of current function. I prepared an example that can demonstrate the problem (see code bellow): The program flow is this: (1) It starts with "session_start()" and displays "login_form()". (2) When user enters his username and password, it goes to "login()" function which sets $_SESSION variables. (3) This function also "Echoes" session_id and user name to the screen. (4) Then it goes to "MyProgram()" function. It only "Echoes" the same variables to the screen. Strange is, that the session_id is the same in (3) and (4), but the user name ($_SESSION["username"]) is only in (3), but not in (4). By other words - $_SESSION["username"] variable filled up by "login()" function is immediately cleared. I don't know why. There must be something missing, but after 3 days of watching it, I can not find a problem here. =========================================== <? Function login($uzivatel, $heslo) { $_SESSION["username"] = $uzivatel; $_SESSION["pass"] = $heslo; $U_Name=$_SESSION['username']; echo "Login username: $U_Name<BR>"; echo "Login session ID: "; echo session_id(); echo "<BR>"; } Function login_form() { echo ("<DIV ALIGN='center'> <H1>Test</H1> <P>Please enter your username and password:</P> <form action='test.php' method='get'> <INPUT TYPE='HIDDEN' NAME='login' VALUE=TRUE> <TABLE BORDER=Ɔ'> <TR> <TD ALIGN='right'><U>U</U>ser name:</TD> <TD><INPUT NAME='uzivatel' SIZE=25 ACCESSKEY='U' TYPE='TEXT'></TD> </TR> <TR> <TD align='right'><U>P</U>assword:</TD> <TD><INPUT NAME='heslo' SIZE=25 ACCESSKEY='P' TYPE='PASSWORD'></TD> </TR> <TR> <TD COLSPAN=2 ALIGN='RIGHT'><INPUT NAME='OK' ACCESSKEY='O' TYPE='SUBMIT' VALUE='OK' TABINDEX=3></TD> </TR> </TABLE> </FORM></DIV></HTML>"); } Function MyProgram() { $U_Name=$_SESSION['username']; echo "Program username: $U_Name<BR>"; echo "Program session ID: "; echo session_id(); echo "<BR>"; } { session_start(); if ($_SESSION['username']): MyProgram(); else: { if (!$login): login_form(0); else: login($uzivatel, $heslo); MyProgram(); endif; } endif; } ?> ===========================================
View Replies !
View Related
Language Would
Most social networking sites seem to be coded in PHP. I really want to build mine using classic ASP as this is the language my trusted friend has a talent for. This seems to make sense in the short term. However I worry about the lack of social networking sites built with ASP. There must be reasons for this. So plan to recode using PHP and transport existing database across once I have earnt enough from the website to pay for the services of a qualified person.
View Replies !
View Related
Language Translator
I need a language translation script for my site but I don't want to use such a translator which change my url like google does , as if i m on page mysitename.com and I need to translate it to spanish and use google widget it translates my page in a way that it changed my url to translate.google.com/?site=mysitename.com can any body help me in this regard so that I might be able to translate my web pages which have dynamic contents are rapidly changing, with out changing the url or any other change to my pages. I just ned to translate my pages to spanish and user should not feel any difference that I have used any widget or any other site facility.
View Replies !
View Related
Multi Language
I have thought a bit about how to implement multi language on a site. It seems to me that there are to ways. 1. The gettext method. That is, create a class for every supported language. 2. Put the language into the db. Now there are to ways that I could walk to find my wisdom in this area. 1. Try both methods an see which is best. 2. Ask someone else what they think. I have alot of text on the site.
View Replies !
View Related
Language Recognition
Okay, this trick could be seen on GOOGLE, if your system's default language is not English. If it is, for example, Russian, GOOGLE automaticaly recognizes it and loads all the links and the such (the interface in other words) in Russian. My question: if and how it could be done, using PHP?
View Replies !
View Related
Language Functions
Is there a way in php to tell what language a string is in? IE: I've got 4 different language coming into my DB. I need to be able to tell what language a certain string is in, and then setting a flag on that record accordingly. The languages in question are korean, japanese and chinese. (and english)
View Replies !
View Related
Language Problem
I have site under development and having problem with language swithching. When I switch to another language it forwards me to index.php instead I need to stay under same web page but on another language. and wish to switch to english clicking on flag, link should only add this on above mentioned url so I can then stay on same page and see page on other language I selected from link to flag: PHP Code:
View Replies !
View Related
PHP GTK Vs Every Other Stand-alone Language
It seems to me PHP-GTK has all those nifty PHP-features packed inside. I must say I am kindof a PHP-freak because te syntax and variant-types I like so much I really want to keep programming in PHP and PHP-GTK more and more. Does somebody have a different view on this? I am progamming this on a windows-machine and haven't seen any other language perform better after slamming programs together.
View Replies !
View Related
Language Script
For example I compare two values and if those values match then script should take another value from array and then echo it.I just need do know how do skip saying the variable value when they match.Hope someone gets what i need. It's like script for learning new words in other languages and when he asks me a new words, then i don't want to see those words come around...
View Replies !
View Related
Language Direction
I have a php site. It is multilingual. I would like to have the language direction be ltr for english and rtl for the other language, I know in regular html I would be inserting in the html tag of the specific language index file <html dir="rtl">. What do I do in php - I know which files to insert in but I dont know what? I understand it should be a define statement and I have one define statement define('LANG_CODEPAGE', 'iso-8859-1') should I be adding something to this?
View Replies !
View Related
Scripting Language
I want to learn a scripting language to make my website interactive. Between Javascript and PHP, Which is easier to learn? Which is more popular? Which can do more tasks? Which is more stable? Which do you prefer and why?
View Replies !
View Related
Scalable Language Db
Using multiple language files for static content is no problem. However I have a drop down option menu that is updated daily...The data is kept in MySql... Example of the database fields: item_id item_parent_id item_name item_description I don't want to add: item_name_english, item_name_spanish because we will get many more languages and this needs to scale... Would you build a seperate language table and do a join? Or is there an easier way that I'm not seeing?
View Replies !
View Related
Name This Programing Language
Working on a redesign using PHP and static HTML nothing special realy. But through all the pages the programmer use a language I'm not familiar with to do includes like this one: [+ inc('.mnu') +] And database connections. Can any one tell me what this is? PEAR?
View Replies !
View Related
Selecting The Next Language
We are a software company that provides Inventory & Procurement mangement to the hospitality industry. For the past twenty years we have been using Progress Software as both the development language and the underlying database. We are in the process of exploring new languages to write our application in, as Progress is becoming expensive for us. Code:
View Replies !
View Related
The Language Development
Is PHP developed from C programming language? If one has to to contribute to the language, what are the steps he/she should take. I can't categorize my C programming skills at the top end, but I can be better at it through time to contribute certain things at some point in time.
View Replies !
View Related
Language Problems
I have a script which dumps my entry(blog) into the database everytime i finished typing. I have a problem with sending asian languages into the database using this php script. I currently do not have the script with me as my comp is down. The script uses only simple "insert" statements to add an entry into the database.Can anyone tell me what I should do either at the db end or at the script end to solve the problem? The asian languages I am having problem with is Chinese(both simplified and traditional). The encoding I use for browser is UTF-8.
View Replies !
View Related
Using Language Files
I have a script which is in English, but i need this script to show both English and German. the English language already has a language file ( english.php ), so i am going to translate all the English wording to German ( german.php ) so how can i select the language file, i am going to let the user select the language via a flag image so when the user clicks on there country flag it will change the site to the requested language.
View Replies !
View Related
Language Translations
We are looking for Freelance Translators and bilingual people to work on our Translation Projects. Globalization process creates more than ever growing demand for Language Translations. We have being constantly expanding, and looking for additional resources in various languages, and areas of expertise.We will be contacting you when projects, requiring your skills and expertise are needed. We and our team look forward to hearing from you and working.
View Replies !
View Related
Language Support
I have used file_get_contents to grab some information from a page that is written in Chinese and then stored it in a database. When I retrieved this information and printed it onto my website the characters are all messed up. I know this has something to do with Character sets but can someone please explain this to me. The site was http://cn.yahoo.com/. Am I able to retrieve information from websites in Asian languages using file_get_contents ??
View Replies !
View Related
Language Pack
I have decided to create a similar method as a resource file for my language pack. I have a table with a filed for each langugae and a filed for the key - this enables me to generate an array with the as listed in the database table and the corresponding string. When using characer sets like chinese and japanese I only see the or those infernal rectangles. My databse can store the characters as they are but the page just won't play ball I have.
View Replies !
View Related
Language Filter
I am using a language filter and for some reason I am getting this error Notice: Undefined variable: stars in C:Program Fileslahh on line 61 here is my code: function language_filter($string) { $obscenities = @file("foul_language.txt"); foreach ($obscenities as $curse_word) { $curse_word = trim ($curse_word); if (stristr(trim($string),$curse_word)) { $length = strlen($curse_word); for ($i = 1; $i <= $length; $i++) { $stars .="*"; } $string = eregi_replace($curse_word,$stars,trim($string)); $stars = ""; } } return $string; }
View Replies !
View Related
Detecting Language
I have been looking for something like this, but can only find detection of the users language. But thats not what I am looking for. I tried to build it myself, but to be honest it's not very beautiful and not (not even nearly) a good solution. Now, how do you figure out, what language he has typed. (I need to check between THAI, ENGLISH, JAPANESE, CHINESE, FRENCH, GERMAN (at least, more would be better).
View Replies !
View Related
Preg_replace :: Language
i have a problem regarding how to update a certain assign word i have a file called language.php the content is something like this $language["other"]="other content"; $language["meuforlife"]=" this is the menu "; now how can i use preg_replace to replace a certain language like i want to change the content of $language["other'] = "other content" to $language["other"]="this is the latest update";
View Replies !
View Related
Language Encoding
im writing a multi-language website and need to use this: <meta http-equiv="Content-Type" content="text/html; charset=big5"/> for the chinese version. It works well on a noraml html files but somehow it fails to work on php files, and all chinese characters were not able to display correctly. Im not sure what went wrong, can anyone give me any suggestions?
View Replies !
View Related
Language Preference Detection
Here is something I came up with to detect the language preference of the browser, and to keep track of any user-defined language preference. Very useful for site translation projects! // Keep track of preferred language session_start(); session_register('language'); // Determine language preference if(IsSet($language_request)) $language = $language_request; elseif(IsSet($language)) $language = $language; else $language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2); $language_request would be a variable that the user would set, for instance by clicking on a link that said "English", something like the following: <a href="<?php echo $PHP_SELF; ?>?language_request=en">English</a> If anyone else has other methods for doing this, I would love to see them...
View Replies !
View Related
Sharing Php Object In A Different Language
Please somebody help me to know how to access an object from a php application, in a different application developed in different language running on a different operating system. in short how to share processing between a php programm and program developed in different languages running on different paltforms.
View Replies !
View Related
Site In Multiple Language
I am creating a site which will have one option for change language. once user selects the language i am storing his reply in session variable. then i want to display the site in his selected language. so can anyone give me idea that how can i achieve this???? whether i should use database for storing words in different languages or i should use file for each language. is there any other better way to solve this problem?
View Replies !
View Related
Assembly Language Inside PHP - Possible / Not ?
I'd like to know whether it is possible to use inline assembly code inside PHP? Remember good old Turbo Pascal 7, one could write Assembly language inside it if you have a function that will be ran millions of times inside a loop? This sped up the process by hundred-folds because of the speed of that bit of assembly language. Well, I'd like to do the same in PHP, but am unable to find any conclusive evidence (and help) on whether this works and how.
View Replies !
View Related
PHP As An Embedded Scripting Language
......ie in my application! Basically I want to add a scripting language to a cross platform application. The prime requirements are that it is: a) Small b) May be easily staticlly compiled into the app and require nothing more than libc and sockets. c) It must be easy to add new functions in C to hook into the app. d) Reasonably easy to learn and use. After looking at the many options available I have almost settled on Lua, however I would **like** to use PHP, I have used the apache PHP module for server side scripting in the past and like it. It has been excluded a bit from my choice because I could not find out anything **about** using it as an embedded scripting language for apps, and any attempt to search for e.g "PHP embedded" results in zillions of references to embedding in HTML etc. Can anybody give me any pointers or tips on this aspect/use of the language?
View Replies !
View Related
Language File, Best Practice
I would like to add international support for my site to allow some of my users to translate the site if they really feel the urge to do it. I don't use any CMS, the site was developed, (and refined :)), by me. But I see that various CMSs handle languages very differently. Joomla! for example has a smallish define file that has all the translations. Wordress on the other hand seems to have a function __(...) that is altogether a lot more complicated but also more flexible. But I am not sure that the Joomela! approach is the best, defining what could become a rather big language file seems a bit silly to me, (well in my case it seems to be). And there does not seem to be any naming convention of all those defines, that could spell<sictrouble. So, what is the best way, so far, of handling languages?
View Replies !
View Related
Multi Language Concept
i would like to implement multi language option for my scripts.Like, when the user clicks on the english, the pages are viewed in english and if in french, they are viewed in that language.For instance, i have settings on my navigation bar and when i click on that, a php page is opened.Inside this php page, i included some .ini files.Now, i want these ini files to be displayed in the language chosen.For this, i created a table called language, added all those .ini modules and their corresponding text phrases in the 2 different languages. How can i proceed further?
View Replies !
View Related
HTML Language Question
I know this is not an HTML newsgroup per se. I looked for comp.lang.html, I guess there is not one. After writing PHP code within my application and viewing the HTML code. I've noticed my editor has caused the positioning of all my HTML tags to be misaligned and jammed together. Do you know of a utility that will realign and set up the indentations for an HTML file? Is there a code beautification program for HTML?
View Replies !
View Related
EzPublish Template Language
Before starting to use ezPublish, I'm working my way through the documentation and I get the feeling I'm missing something. Does anybody know a clear and nicely structured manual for the ezPublish template language ? Perhaps one is on the site, but I couldn't find it.
View Replies !
View Related
Is PHP The Best Language On Linux With Apache?
I am about to use server side technology with our new server (I want to begin using dynamic pages). These are the details: Apache Web Server 1.4 on Linux Red Hat 7.1 PHP 4.06 Perl 5.6 SSL MySQL 3.23 Could you tell me what is the best server side language to use for dynamic pages? I know PHP is becoming very popular. But I am from an ASP and JSP background. I could set up the server to use JSP and servlets etc but is there much point if PHP and Perl are installed? I've heard these are good and fast!
View Replies !
View Related
Is PHP The Right Language For This Application (described Below)? If Not, Any Suggestions?
Let me start off by saying "I'm not a programmer", although I do understand the basic concepts. The question I have is two-fold. First, which language should this application be written in (PHP, SQL, JS, etc.)? Second, can anyone give me any pointers, or provide a price quote for writing this? Please take a look at the details below if you're interested. In general: the application I'm looking for is similar to the functionality of Postlets (www.postlets.com) / WebFlyer (www.webflyer.com) - **read database info & create HTML code for Craigslist**, but with a couple of differences. First, the datafeed to other sites is not a necessity (although a nice extra); second, the application *must* add some corporate / legal information to the listing. Any PHP/SQL/JS programmers out there, who would like an interesting freelance project,
View Replies !
View Related
|