
May 30th, 2000, 03:56 AM
|
|
Contributing User
|
|
Join Date: May 2000
Posts: 33
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
All previous advice was correct - you can't combine a server-side language with a client-side one. I have only one thing to advise to you - pass your variable to a href which leads to your php file, in the form (for example) myfile.php3?lang=eng + 'MyVariable'. In an anchor, you have to combine it with <a href="javascript:....."
This is an example of how I combine Javascript and PHP to make a page modification script in two languages displayed in two frames:
<script>
function load(url) {
top.frames[1].location.href=url + '&lang=ru';
top.frames[2].location.href=url + '&lang=eng';
}
</script>
<select name="select" ONCHANGE="load(this.options[selectedIndex].value)">
<option value="text1.php3?cat=aboutme">Welcome page</option>
This script is in the first frame and controls the two frames below - they display the same page in two languages. You don't have to write a function for your case. I am not very experienced in Javascript, but you may even ask on the javascript forum on devshed how to do this.
Good luck
|