查看: 881|回复: 4
|
PHP, javascript n xhtml
[复制链接]
|
|
i got a parent window that call out the child window......
in the child window i successful get the value from the parent window by using opener.document.getElementById.
because i want show the xhtml based on the value i get, so i had using PHP to compare with the language i get.
but the problem now is i cant compare although the value same as i get.
for example:
in parent window:
<input type = "hidden" name = "text1" id = "text1" value = "abc">
in child window:
<? $getValue = "<script language = 'language'>document.write(opener.document.getElementById('text1').value);</script>";
if($getValue == "abc")
{
echo"<table><tr><td>same</td></tr></table>";
}
else
{
echo "<table><tr><td>different<td></tr></table>";
}
?>
but the problem now is, it always show "different" message. y like that de??
i try to show d $getValue 's value, it show out "abc".
anyone can help me n tell me what is the problem??
thanks |
|
|
|
|
|
|
|
发表于 30-8-2006 10:47 PM
|
显示全部楼层
u cannot join javascript value and php value in this way. what actually you want to do to get the parent form value? where the parent form value coming from? |
|
|
|
|
|
|
|
发表于 31-8-2006 01:19 PM
|
显示全部楼层
连Java Script/PHP的基本入门也没搞清楚就写code..
PHP是Server side 处 compiler 处理后http给client side 的..
而Java Script是client side 的browser处理的.. |
|
|
|
|
|
|
|
发表于 31-8-2006 02:27 PM
|
显示全部楼层
这令我看了一头雾水的问题...
还是别写英语吧... 用中文来写吧... 否则写到乱七八糟看的人也辛苦. |
|
|
|
|
|
|
|
发表于 31-8-2006 10:14 PM
|
显示全部楼层
非中文发表的贴我不帮。
再说,楼主的英文带些语病。 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|