want to access php varable in java script
Posted: Fri Jun 12, 2009 6:32 am
hi i want to access the php variable in java script. see i will explain the problem
first answer to these questions
1>client machine does not know php right. so i cannot access the php variable at client side using java script. but how about this can i access java script variable at server side?
the problem is using php i am getting some entries from database filling it inside the html dropdown list like this
and iam having another text box i want to display corresponding $array[1] in it. I.e., i want to display corresponding manager id of the company selected from the drop down in the text box.
and i want to do it without going back to server.
first answer to these questions
1>client machine does not know php right. so i cannot access the php variable at client side using java script. but how about this can i access java script variable at server side?
the problem is using php i am getting some entries from database filling it inside the html dropdown list like this
Code: Select all
<?php $result=mysql_query("select Company,ManagerName from manager_Prof"); ?>
<select name=drpcompany >
<?php while($array=mysql_fetch_row($result)): ?>
<option><?php echo $array[0]; ?></option>
<?php endwhile; ?>
</select>
and i want to do it without going back to server.