Created
December 19, 2012 20:33
-
-
Save anonymous/4340203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(isset($_POST['username'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$title = $_POST['title']; | |
$body = $_POST['body']; | |
$connect = mysql_connect("localhost","fatihdur_deneme","110303"); | |
if (!$connect) | |
{ | |
die('Bağlantı Kurulamadı: ' . mysql_error()); | |
} | |
mysql_select_db("_deneme",$connect); | |
$sql = "select * from users where username = '$username' and password='$password'"; | |
if(!mysql_query($sql, $connect)) //İLK HATAN BURADA | |
{ | |
die('Hata: ' . mysql_error()); | |
} | |
$sonuc = mysql_affected_rows(); | |
if($sonuc > 1) | |
{ | |
$sql2 = "INSERT INTO posts (title, body) | |
VALUES ('$title','$body')"; | |
if(!mysql_query($sql2, $connect)) //İLK HATAN BURADA | |
{ | |
die('Hata: ' . mysql_error()); | |
} | |
echo 'Yazı Kaydedildi'; | |
mysql_close($connect); | |
} | |
else{ | |
echo 'Kullanıcı Adı/Şifre Hatalı'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment