Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9155221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:33:16+00:00 2026-06-17T12:33:16+00:00

i am creating a website by two language with php. to change language of

  • 0

i am creating a website by two language with php. to change language of pages , i create to link like this:

<a href="/?lang=fa">FA</a>|<a href="/?lang=en">EN</a>

this two link is on a page named header.php that includes on some page.but in some pages is some parameters that send via URL . So that two link are not true and they Should be as follows:

<a href="aPage.php?id=1&lang=en">FA</a>|<a href="aPage.php?id=1&lang=en">EN</a>  

my Question is how i create a dynamic links for all page Even if have some parameters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:33:17+00:00Added an answer on June 17, 2026 at 12:33 pm

    You could use:

    <?
    $params = $_GET;
    $params['lang'] = 'EN';
    $qs = '?';
    foreach($params as $k=>$v)
      $qs .= $k.'='.urlencode($v).'&';
    $url = substr($_SERVER['PHP_SELF'].$qs, 0, -1);
    
    echo $url; //EN
    
    $params['lang'] = 'FR';
    $qs = '?';
    foreach($params as $k=>$v)
      $qs .= $k.'='.urlencode($v).'&';
    $url = substr($_SERVER['PHP_SELF'].$qs, 0, -1);
    
    echo $url; //FR
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Programming Language: PHP v5.3) I am working on this website where I make search
I'm creating a fairly simple website. There are two static pages (Home and Portfolio)
I am creating an website. It has two web pages. I am trying to
I have two questions about creating shadows like www.apple.com/ipodshuffle ... On the website, you'll
I'm creating a website and on one page of the site (it's .php) I
I'm creating a website designed by a print-designer. The background concists of two images:
I am creating a website where there are two user intefaces. ONe for sellers
I'm creating a PHP website which involves users signing up, and I'm wondering about
I am creating a website in which I have two different buttons. By using
I'm creating a login script for a website i'm developing, and am using PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.