Include file conditional

Posted on 2013-10-28
Medium Priority
Last Modified: 2013-11-02

I need to include a file depending of the language of the page defined by url.

It's working ok for welcome page

but it's not working on other pages like

Here is the code

if($page == "welcome" && ( $lang == "_en" || $lang == "") )
elseif($page == "welcome" && $lang == "_fr")


Open in new window

Question by:lenamtl
  • 3
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 39607416
You're not checking for any other page than 'welcome'.
LVL 27

Author Comment

ID: 39607432
How can I check also other pages that end by _fr or _en
I have only 10 pages per language
LVL 27

Accepted Solution

lenamtl earned 0 total points
ID: 39607438
I will add them manually like this "welcome" || "services"  

if($page == "welcome" || "services"  && ( $lang == "_en" || $lang == "") )
LVL 27

Author Closing Comment

ID: 39618574
I have found myself the complete solution
Other expert point the problem so this is why I want to awarded him the point

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question