Page 146 - MDP2022-2
P. 146
}
else {
echo "PWD error";
}
}
else {
echo "ID error";
}
}
else{
echo "no";
}
?>
회원가입 화면(php)
<?php
include_once "server.inc";
$con = mysqli_connect();
if($_POST["pwd"]=="NONO"){
if(!empty($_POST["id"])){
$sql = "select id from addre where id='" . $_POST["id"] . "';";
$result = mysqli_query($db_connect, $sql);
$record = mysqli_fetch_assoc($result);
if($record) {
echo "same";
}
else{
echo "notsame";
}
}else{
echo "non";
}
}
else{
if (!empty($_POST["id"]) && !empty($_POST["pwd"]) && !empty($_POST["name"]) && !
empty($_POST["number"])) {
$sql = "select id from addre where id='" . $_POST["id"] . "';";
$result = mysqli_query($db_connect, $sql);
$record = mysqli_fetch_assoc($result);
if($record) {
echo "ID 중복";
}