我想做个网页,输入账号和密码然后按下登陆按钮,在数据库中查找匹配項,应该怎么相互调用PHP和JS呢
本人完全没有PHP和数据库编程的经验,请各位大神详细解答。代码如下,谢谢
<input name="button" type="submit" id="button" onclick="call_php('textfield.getAttribute('value')', 'textfield2.getAttribute('value')')" value="提交" />function login($user_name, $user_password)
{
do
{
if($row_rs_loginUI['user_name'] == $user_name &&
$row_rs_loginUI['user_pwd'] == $user_password)
{
return true;
}
}
while($row_rs_loginUI = mysql_fetch_assoc($rs_loginUI));
return false;
}
<script type="text/javascript">
function call_php(user_name, user_password) { //v1.0
if("<?php login(user_name, user_password);?>" == true)
{
alert("sucessed");
}
}
</script>PHPJavaScript数据库
本人完全没有PHP和数据库编程的经验,请各位大神详细解答。代码如下,谢谢
<input name="button" type="submit" id="button" onclick="call_php('textfield.getAttribute('value')', 'textfield2.getAttribute('value')')" value="提交" />function login($user_name, $user_password)
{
do
{
if($row_rs_loginUI['user_name'] == $user_name &&
$row_rs_loginUI['user_pwd'] == $user_password)
{
return true;
}
}
while($row_rs_loginUI = mysql_fetch_assoc($rs_loginUI));
return false;
}
<script type="text/javascript">
function call_php(user_name, user_password) { //v1.0
if("<?php login(user_name, user_password);?>" == true)
{
alert("sucessed");
}
}
</script>PHPJavaScript数据库
解决方案 »
- 问题未解决,接着提问!关于查询结果特殊显示的问题!
- 如何防止网站被小偷程序偷取。
- 小弟跪求给位大侠知道怎样才能把输入的字符一个一个的分开来啊,急急急……
- php+sql server参数传递问题?
- php读取数据库中text数据以后,如果是多行数据,如何传递给javascript?
- 一个面向对象方面的很基础的小白问题,求指点
- IIS6+PHP+MYSQL安装后出现的问题
- 关于模板问题,有没好的解决方法~~
- JS和PHP的问题~~~~~~~~
- 如何用php定时把一个mysql数据库的表复制到另一个数据库
- PHPCMS 中怎么做调用分页标签不显示效果了在线等.....麻烦知道的进!
- php接入用python实现 有问题!!!求解
用ajax来实现,建议去看看ajax的用法。