gaz_hayes Posted September 3, 2007 Share Posted September 3, 2007 OK, I am really new and naive to php so please be nice! I am running a moderately popular php shopping cart script The use global language variables in the site, so I was hoping to detect the language, and show my custom pages in that language. I'm using iframes to show my custom content. So I need to do something like this (but in php of course ) if 'language_variable' = 'english' then echo '<iframe src="content_en.html" />; if 'language_variable' = 'chinese_simp' then echo '<iframe src="content_zh_cn.html" />; if 'language_variable' = 'chinese_trad' then echo '<iframe src="content_zh_tw.html" />; if 'language_variable' = 'japanese' then echo '<iframe src="content_jp.html" />; I think this should be pretty simple right? If I knew some basic PHP Quote Link to comment https://forums.phpfreaks.com/topic/67774-if-then-question/ Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 You might want to take a look at the manual, this is very basic stuff. <?php if ($expression) { // do something. } else { // do something else } ?> Quote Link to comment https://forums.phpfreaks.com/topic/67774-if-then-question/#findComment-340463 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.