//write.html//////////////////////////////////////
±Û¾²±â
//write.php//////////////////////////////////////
if($name == "" || $email == "" || $hpage == "" || $subject == "" || $content == "" || $dbpass == "") {
echo "";
exit;
}
echo "³Ñ¾î¿Â À̸§ : $name
";
echo "³Ñ¾î¿Â À̸ÞÀÏ : $email
";
echo "³Ñ¾î¿Â ȨÆäÀÌÁö : $hpage
";
echo "³Ñ¾î¿Â Á¦¸ñ : $subject
";
echo "³Ñ¾î¿Â ³»¿ë : $content
";
echo "³Ñ¾î¿Â ºñ¹Ð¹øÈ£ : $dbpass
";
$user_ip=getenv("REMOTE_ADDR");
echo "user_ip --- $user_ip
";
include "connect.php";
$query="insert into board1 values(NULL,'$name','$email','$hpage','$subject','$content','$dbpass','$user_ip',now(),0)";
$result=mysql_query($query);
if($result){
echo "ÀÔ·Â ¼º°ø";
}else {
echo "ÀÔ·Â ½ÇÆÐ";
}
?>
//conect.php/////////////////////////////////////
$connect=mysql_connect("localhost","apple","123456");
$db=mysql_select_db("appledb",$connect);
?>
//board1db.php///////////////////////////////////
include "connect.php";
$query="create table board1(
num int not null auto_increment primary key,
name varchar(20) not null,
email varchar(30) not null,
hpage varchar(50) not null,
subject varchar(70) not null,
content text not null,
dbpass varchar(20) not null,
userip varchar(30) not null,
reg_date date not null,
cnt int not null)";
$result=mysql_query($query) or die(mysql_error());
if($result){
echo "°Ô½ÃÆÇ Å×ÀÌºí »ý¼º ¼º°ø!";
}else {
echo "°Ô½ÃÆÇ Å×ÀÌºí »ý¼º ½ÇÆÐ!";
}
?>
//or.php////////////////////////////////////////
//³í¸® ¿¬»êÀÚ OR : || AND : &&
//°ü°è ¿¬»êÀÚ < > == !=
$a=0 || 0;
$b=0 || 1;
$c=1 || 0;
$d=1 || 1;
echo "a --- $a
";
echo "b --- $b
";
echo "c --- $c
";
echo "d --- $d
";
echo "
======================
";
$a=0 && 0;
$b=0 && 1;
$c=1 && 0;
$d=1 && 1;
echo "a --- $a
";
echo "b --- $b
";
echo "c --- $c
";
echo "d --- $d
";
?>