Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 26

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 26

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 26

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

618 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