473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem with session

My site has:

- 1 frame in top where I have some images to change the language of
the site if clicked

- 1 frame at left for the menu

- 1 frame at middle to load the page chosen in menu

in the index.php my code is

(i save in a var the name of the page displayed and the language active)

if(!isset($_SESSION['mainform']))

{

$_SESSION['mainform'] = "main.php";

}

if(!isset($_SESSION['language']))

{

$_SESSION['language'] = "ITA";

}

in the TopFrame my code is

<SCRIPT language="JavaScript">

function LanguageChange(language)

{

//i get the current viewed page
document.TopForm.main_form.value=parent.document.a ll.mainFrame.src;

//i change the site language

switch (language)

{

case 'ITA':
document.TopForm.selected_language.value='ITA';

<?php $_SESSION['language']='ITA'; ?>

break;

case 'ENG':
document.TopForm.selected_language.value='ENG';

<?php $_SESSION['language']= 'ENG'; ?>

break;

}

document.TopForm.submit();

}

</SCRIPT>

$TMPLAN=$_ SESSION ['language'];

echo"

<form name=\"TopForm\">

<input name=\"selected_language\" type=\"hidden\" value=\"$TMPLAN\">

<input name=\"main_form\" type=\"hidden\" value=\"main.php\">

<table>

<tr>

<td>

&nbsp;<img src=\"../italiano.bmp\" onClick=\"LanguageChange('ITA')\">

</td>

<td>

&nbsp;<img src=\"../inglese.bmp\" onClick=\"LanguageChange('ENG')\">

</td>

</tr>

</table>

";

in una mia pagina che carico al FrameCentrale utilizzo queste istruzioni

(i have to read the variable of the 2 session or read the value in
document.TopForm.selected_language)

<?php

if ($_SESSION['language']=='ITA')

echo "testo italiano";

else

if ($_SESSION['language']=='ENG')

{

echo "testo inglese";

}

?>

the problem is that i can't change the language as i aspect.

Can anyone help me as soon as possible, please.
Jul 17 '05 #1
0 1406

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: | last post by:
I have a problem with session in my version of PHP I use WinXP (FAT32), Apache, latest PHP. In Linux, Apache, latest PHP instead it works fine! So, my program is: ----------------In Windows...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
8
by: Ashish | last post by:
Incase the problem got bogged down reposting... Hi Gregory, I think I didnt make myself much clear. The problem is: 1. I have one ASP.NET application (no classic asp) and it has a main page...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
0
by: Alexander Widera | last post by:
hello all, i have a problem ... like I already discussed in the thread "session empty" I have the following problem: I created a completely new web... i added 2 files: sessiontest1.aspx:
2
by: Tom | last post by:
I hope someone can help me figure out what's going on here. I've re-read the section on sessions at php.net and Googled this high and low but I haven't found anything that quite explains my...
0
by: fiefie.niles | last post by:
I am having problem with thread. I have a Session class with public string variable (called Message) that I set from my Main program. In the session class it checks for the value of Message while...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.