컴퓨터/노트북/인터넷
IT 컴퓨터 기기를 좋아하는 사람들의 모임방
🕰️
2014.06.14 05:28
php 회원탈퇴소스 변경어떻게 해야할까요? ㅜ
조회 수 3068 추천 수 0 댓글 1
현재 로그인 상태에서만 회원탈퇴를 뜨게하고
회원탈퇴를 누르면 회원탈퇴가 되었다고 뜨고 로그인 화면으로 돌아가지만
실제 db에서는 삭제가 되지 않습니다.
top_login부문 소스입니다.
<div "logo"><a href="../index.php"></a></div>
<div "top_login">
<?
if(!$userid)
{
?>
<a href="../login/login_form.php">로그인</a> | <a href="../member/member_form.php">회원가입</a>
<?
}
else
{
?>
<?=$usernick?> (level:<?=$userlevel?>) |
<a href="../login/logout.php">로그아웃</a> | <a href="../login/member_form_modify.php">정보수정</a> | <a href="../login/member_delete.php">회원탈퇴</a>
<?
}
?>
</div>
member_delete.php 소스
<?
session_start();
?>
<meta charset="euc-kr">
<?
include "../lib/dbconn.php"; //db연결소스
$sql = "delete from member where id = $id";
$sql = "where '$userid'";
mysql_query($sql, $connect);
mysql_close();
회원탈퇴를 누르면 회원탈퇴가 되었다고 뜨고 로그인 화면으로 돌아가지만
실제 db에서는 삭제가 되지 않습니다.
top_login부문 소스입니다.
<div "logo"><a href="../index.php"></a></div>
<div "top_login">
<?
if(!$userid)
{
?>
<a href="../login/login_form.php">로그인</a> | <a href="../member/member_form.php">회원가입</a>
<?
}
else
{
?>
<?=$usernick?> (level:<?=$userlevel?>) |
<a href="../login/logout.php">로그아웃</a> | <a href="../login/member_form_modify.php">정보수정</a> | <a href="../login/member_delete.php">회원탈퇴</a>
<?
}
?>
</div>
member_delete.php 소스
<?
session_start();
?>
<meta charset="euc-kr">
<?
include "../lib/dbconn.php"; //db연결소스
$sql = "delete from member where id = $id";
$sql = "where '$userid'";
mysql_query($sql, $connect);
mysql_close();
echo("
<script>
alert('[탈퇴성공] 정상적으로 회원에서 탈퇴하셨습니다.');
location.href = '../index.php';
</script>
");
?>
<script>
alert('[탈퇴성공] 정상적으로 회원에서 탈퇴하셨습니다.');
location.href = '../index.php';
</script>
");
?>
이 부분에서 현재 로그인한 유저의 아이디를 받아서 삭제 해야하는것같은데 초보라 뭐가 잘못된건지 잘 모르겠습니다.
회원가입자의 정보를 저장하는 member.sql 소스
create table member (
id char(15) not null,
pass char(15) not null,
name char(10) not null,
nick char(10) not null,
br char(20) not null,
hp char(20) not null,
email char(80),
regist_day char(20),
level int,
primary key(id)
);
php고수님들 답변좀 빨리 부탁드려요 ㅠㅠ!
회원가입자의 정보를 저장하는 member.sql 소스
create table member (
id char(15) not null,
pass char(15) not null,
name char(10) not null,
nick char(10) not null,
br char(20) not null,
hp char(20) not null,
email char(80),
regist_day char(20),
level int,
primary key(id)
);
php고수님들 답변좀 빨리 부탁드려요 ㅠㅠ!