在form表单中有这种PHP的用法吗?<input type="text" onKeyPress="<?php a(); ?>" name="show">,详情请进。 a()是什么?或是说a()输出什么?请注意,b/s结构中js和php要通过http协议沟通。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哦sorry,a()是在PHP中定义的函数,是这样的<?phpfunction a(){$conn(); //connect the database$sql="select a,b.. from datatable where tima='".$show."'";$result=mysql_fetch_array(mysql_query($sql));}?><form action="...." method="post"><input type="text" onKeyPress="<?php a(); ?>" name="show"><input type="text" value="<?php echo $result['a'];?>"</form>对不起,刚才写错了。Thanks again! onKeyPress不能响应php的函数,你只能把它提交到服务器进行数据库的操作。可以这样写:<script language="javascript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}function a(){show = document.form1.show.value; MM_openBrWindow('处理文件.php?show=' + show ,'','scrollbars=yes,width=540,height=480');/**处理文件.php,你是新开窗口还是别的,自己看着处理就行了***/}//--></script><form action="...." method="post" name=form1><input type="text" onKeyPress="javascript:a()" name="show"><input type="text" value="<?php echo $result['a'];?>"</form> onKeyPress是在客户页面下执行的不能调用php执行 onKeyPress事件发生在客户浏览器端,老大? 我明白了,谢谢各位大侠不过此贴我打算过两天再结,不知大家愿不愿意更具体的谈谈客房端与服务器端的区别TKS very much! 高手进来,关于PHP问题 关于ora_bind()的问题 急!请帮帮忙! php怎么禁止过多重复的请求 删除数组出错,只能删除最后一位才是对的,怎么回事儿? 怎么能把文字控制格式保存进MYSQL 后台所有操作员的重要操作进行纪录,怎么实现? 有关URL REWRITE的问题,求助 macromedia dreamweaver mx 2004 谁用过啊?请教! PHP报错的问题 最近在做一个mail.ru邮箱自动注册,遇到了瓶颈,谁能提供下思路(php,java都可) 高分求列车查询的实现方式 大家帮忙看一下这个递归函数哪儿错了!
<?php
function a()
{
$conn(); //connect the database
$sql="select a,b.. from datatable where tima='".$show."'";
$result=mysql_fetch_array(mysql_query($sql));
}
?>
<form action="...." method="post">
<input type="text" onKeyPress="<?php a(); ?>" name="show">
<input type="text" value="<?php echo $result['a'];?>"
</form>
对不起,刚才写错了。
Thanks again!
可以这样写:
<script language="javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function a()
{
show = document.form1.show.value;
MM_openBrWindow('处理文件.php?show=' + show ,'','scrollbars=yes,width=540,height=480');
/**处理文件.php,你是新开窗口还是别的,自己看着处理就行了***/
}
//-->
</script>
<form action="...." method="post" name=form1>
<input type="text" onKeyPress="javascript:a()" name="show">
<input type="text" value="<?php echo $result['a'];?>"
</form>
不能调用php执行
不过此贴我打算过两天再结,不知大家愿不愿意更具体的谈谈客房端与服务器端的区别
TKS very much!