Javascript 如何制作一个脚本(PHP)登录到一个站点(没有API)并单击一个按钮?
我想创建一个脚本,登录到一个网站,点击一个按钮,就是这样 我只需要在谷歌上搜索词汇(关键词),因为我真的迷路了 如果你很好,就做个榜样吧!Javascript 如何制作一个脚本(PHP)登录到一个站点(没有API)并单击一个按钮?,javascript,php,automation,Javascript,Php,Automation,我想创建一个脚本,登录到一个网站,点击一个按钮,就是这样 我只需要在谷歌上搜索词汇(关键词),因为我真的迷路了 如果你很好,就做个榜样吧! 多谢各位 基本HTTP身份验证、使用PHP的HTTP身份验证、PHP需要并包括、安全登录脚本PHP、用户身份验证PHP、PHP简单登录脚本、使用sql和PHP的登录身份验证 以下是一些有用的网站: 首先创建一个连接,就像数据库中的连接字符串一样 $email=cleanstr($_POST['email']); $pwd=cleanstr($_POST
多谢各位 基本HTTP身份验证、使用PHP的HTTP身份验证、PHP需要并包括、安全登录脚本PHP、用户身份验证PHP、PHP简单登录脚本、使用sql和PHP的登录身份验证 以下是一些有用的网站:
首先创建一个连接,就像数据库中的连接字符串一样 $email=cleanstr($_POST['email']); $pwd=cleanstr($_POST['password'])强> 将这两个变量用于登录系统的和 电子邮件id和密码
<?php
require_once("connection.php"); // require the db connection
function cleanstr($str){
$cstr=trim($str);
$cstr=htmlspecialchars($cstr);
$cstr=addslashes($cstr);
return $cstr;
}
$email=cleanstr($_POST['email']);
$pwd=cleanstr($_POST['password']);
if(empty($email) && empty($pwd)){
header("location:index.php");
}
else
{
$email=cleanstr($_POST['email']);
$pwd=cleanstr($_POST['password']);
$search = mysql_query("SELECT * FROM users WHERE email='".$email."' AND password='".$pwd."'") or die(mysql_error());
$match = mysql_num_rows($search);
if($match>0)
{
session_start();
$_SESSION['email']= $email;
// log in declare to the other page
$_SESSION['login']=True;
header("Location:index.php");
}
else
{
echo "<script>
window.alert ('Email or Password not match');
window.location.href='login.php';
</script>";
}
// end of if
}
?>
取决于按钮。