我想做个网页,输入账号和密码然后按下登陆按钮,在数据库中查找匹配項,应该怎么相互调用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数据库
解决方案 »
- 从十几万条数据中查找某几条数据 页面反应慢
- 做了一个平台(www.mssqw.cn),想做推广,大家有没有什么好的建议?
- php如何判断utf-8字符串是否是纯中文?
- 有请唠叨,关于smarttemplate
- 这样的时间字符怎么转成时间戮?
- 新手初学PHP,请教这句话中的this->是什么意思?
- 使用dw还是使用zend studio呀?
- 想找一个像CSDN或者,163,SOHU的论坛,这种左右格式的论坛源代码
- 这是什么错误,为什么很多呀!!!!!!!!!!!!!
- 如何得到我想要的date格式
- PHPCMS 中怎么做调用分页标签不显示效果了在线等.....麻烦知道的进!
- php接入用python实现 有问题!!!求解
用ajax来实现,建议去看看ajax的用法。