For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > September 2006 > how read an input field value and assign his content to a php variable









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how read an input field value and assign his content to a php variable
SAN CAZIANO

2006-09-07, 6:57 pm

<?php
$HomePage_ITA="casa";
$HomePage_ENG="house";
?>

<script type="text/javascript">

function SetActiveLanguage(ActiveLanguage)
{
document.getElementById("Language").value = ActiveLanguage;
}

function GetTextVariable()
{
document.getElementById("TextPagina").value =
document.getElementById("TitlePagina").value + "_"
+document.getElementById("Language").value;
}
</script>

<input id="Language" type="text" value="ITA">
<input id="TitlePagina" type="hidden" value="HomePage">

<input type="button" value="ITA" onclick="SetActiveLanguage('ITA');
GetTextVariable()">
<input type="button" value="ENG" onclick="SetActiveLanguage('ENG');
GetTextVariable()">

<input id="TextPagina" type="text"> <!--hidden field -->

<?php
now I have to read the value in the field "TextPagina" and assign his value
to a variable called "$VarAttiva" and next I want to display the value in
this variable with a simple "echo" function (the content of this variable
always link to a php variable defined in the first rows of my php page. how
acn I do this ???.
?>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com