close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

detect system language

Thread began 6/12/2020 3:52 am by Jonas | Last modified 6/12/2020 9:53 am by Jonas | 25 views | 1 replies

Jonas

detect system language

How can I detect system language in a query?

I have found a site that very well describes how to build a multilingual website. The address is: https://www.apphp.com/tutorials/index.php?page=multilanguage-database-design-in-mysql

I intend to use method 4 for my project.

The article shows examples of what a sql query can look like to retrieve appropriate title according to the chosen language in the system.
I think this seems like a smooth solution. Or do you have any better suggestions?

According to another website, you can "pick" the browser language: https://www.geeksforgeeks.org/how-to-detect-browser-language-in-php/
I call the session "lang". And I want to set this to "substr ($ _ SERVER ['HTTP_ACCEPT_LANGUAGE'], 0, 2);"

I have two questions if I should use the examples from the above mentioned pages.
1. How do I write the same query with the WA MySQLi Recordset?
2. How do I create the session. Is this code correct:
<? Php
@session_start ();
if (! isset ($ _ SESSION ["long"])) {
$ _SESSION ["long"] = "substr ($ _ SERVER ['HTTP_ACCEPT_LANGUAGE'], 0, 2);";
}
?>

Is there any complete guide you offer on how to do this? It should be of great public interest.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...