Hello All,
I am developing a website With php as scripting Language.
I have Applications in php scripts, html and JavaScripts.
What I observe is that I can not Access the php variables
those were executed on previous page With the JavaScripts on the NeXT page. Can some one help me resolve this issue.
Below is an simple example :
on one html page I have this:
The main.php file has a session variable called username.
This variable is not retriveble in the above JavaScript.
I hope that some one can help me resolve this.
Many thanks in advance.
Ajeet Phadnis
I am developing a website With php as scripting Language.
I have Applications in php scripts, html and JavaScripts.
What I observe is that I can not Access the php variables
those were executed on previous page With the JavaScripts on the NeXT page. Can some one help me resolve this issue.
Below is an simple example :
on one html page I have this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Longon to Phadnis Domain</title>
</head>
<body>
<p>Let wisdom prevail ...</p>
<iframe src="main.php"></iframe>
<form id="logged_user" method="post" action="getMainPHPForm(this);">
<input id="unam1" name="unam" type="text" value=""/>
</form>
</body>
</html>
<script type="text/javascript">
var tim = '<?php echo time(); ?>';
alert("Time: " + tim);
function getMainPHPForm (formId) {
alert("formnew");
var num = "<?=$_SESSION['uname'] ?>";
alert("num: " + num);
//var un = document.getElementById("unam").value;
var menuLst1 = document.getElementById("lst1");
//alert("menulst : " + menuLst1);
var lstStat = menuLst1.disabled;
alert("lst_status : " + lstStat);
//document.getElementById("unam1").value="<?= $_SESSION['username'] ?>";
//alert("Uform: " );
}
</script>
The main.php file has a session variable called username.
This variable is not retriveble in the above JavaScript.
I hope that some one can help me resolve this.
Many thanks in advance.
Ajeet Phadnis
Comment