佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 881|回复: 4

PHP, javascript n xhtml

[复制链接]
发表于 30-8-2006 09:56 PM | 显示全部楼层 |阅读模式
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
回复

使用道具 举报


ADVERTISEMENT

发表于 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 | 显示全部楼层
非中文发表的贴我不帮。

再说,楼主的英文带些语病。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 14-11-2024 08:05 PM , Processed in 0.130990 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表