4 번 째 줄에 오류가 있습니다. 브래킷이 있어야한다는 것을 알고 있어야합니다. 이 문제를 어떻게 해결할 수 있습니까?등록 스크립트의 오류를 수정하려면 어떻게해야합니까?
<?php
include('config.php');
// for the registration script we need a html form
if($_SERVER['REQUEST_METHOD'] == 'POST' {
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string(md5($_POST['password']));
//retrieve the input from the user and encrypt the password with md5
} if(empty($username)) {
echo("Please enter a Username");
} else {
if(empty($password)) {
echo("Please enter a password");
} else {
//check if username already exists
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$rows = mysql_num_rows($query);
//with mysql_query you call a sql command
if($rows > 0) {
die("Username taken !!");
} else {
$user_input = mysql_query("INSERT INTO users (username , password) VALUES ('$username' , '$password')");
echo("Successfully Registered ");
}
}
}
?>
어떤 환경에서 프로그래밍 하시겠습니까? 어쩌면 넷빈즈 아이디어일까요? 디버깅에 도움이 될 것입니다. – Pakspul
메모장을 사용합니다. ++ aptana studio 및 netbeans와 같은 다른 프로그램을 시도했지만, 메모장을 더 선호합니다. 단순함 때문에 그냥 – user3208543