URL Problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Dec 06, 2013 2:39 am

URL Problem

Postby anilmist » Fri Dec 06, 2013 2:44 am

I have a website , and at the top of the page, there is a dropdown list to let the users specify either English and Spanish as a language.

This works fine if the language is the first selection made on the webpage, and the URL changes to http://www.mywebsite...dex.php?lang=es if Spanish..as it should.

However, if I perform a search further down the page using either free text entry, or by any of the other dropdown boxes, then the language part of the URL is not recognized.

So, instead of a search result ending up as

I get

Here are snippets of the script I have at the moment:

<script type="text/javascript">
function go(){

<form name="lan">
<select name="langu" size="1" onChange="go()">
<option><?php print translate("Language"); ?></option>
<option value="">English</option>
<option value="/index.php?lang=es">Espa&#xF1;ol</option>

<form name='search' action='<?php print $config_baseHREF ?>search.php'>
(the search.php files calls up the rest of the URL after the language).

Also, if the language is changed half way through a session, is there a way to change the language of the page, so that the existing content on the webpage remains, and does not go back to the home page.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 4 guests