답변을 제공해 주셔서 감사합니다! 나는 많은 피드백을 받았으며 대답을 가지고 고쳐 썼다. 감사!MySQL 함수가 작동하지 않습니다.
나는 내 웹 사이트에 대한 사용자 로그인 시스템을 만들기 위해 노력하고 있습니다. 업데이트를 원한다면 정확한 파일을 로컬 서버 (Apache/2.2.22 (Ubuntu))로 옮기고 갑자기 작동하지 않습니다. 데이터베이스가 외부이므로 호스트 이름을 변경할 필요가 없습니다. 어떤 아이디어? 오류가 없으면 MySQL 비트를 구문 분석하지 않습니다.
연결 파일 :
<?php
$host = "xxxxxxx.xxxxxxxxx.xx.xx";
$user = "sh0u_xxxxxx";
$pass = "xxxxx";
$db = "sh0u_1xxxxx_store";
mysql_connect($host,$user,$pass) or die("Unable To Connect To Database");
mysql_select_db($db)
?>
로그인 파일 :
<?php
session_start();
session_destroy();
include('connect.php');
$email = $_POST['email'];
$pass = md5($_POST['password']);
$query = mysql_query("SELECT * FROM users WHERE email='".$email."' AND password='".$pass."'");
$numrows = mysql_num_rows($query);
if($numrows === 1) {
session_start();
$_SESSION['sid'] = "".$email.":".$pass."";
header('Location:../index.php');
}else {
include('../login.php');
echo "<script>alert('Incorrect Username and/or Password');</script>";
}
?>
데이터베이스 서버에 http 연결을해야한다고 생각하지 않습니다. – andrewsi
어떤 PHP를 실행합니까? – putvande
그것 없이도 작동하지 않습니다. – user3478443