Arkadaşlar kodlama konusunda yeniyim. Admin paneli hszırlarken başlıktaki hatayı alıyorum. Çözümünü bir türlü bulamadım nerede hata yapıyor olabilirim ? (kodlama yaparken eğitim videosundan yararlanıyorum) 127. satırda yani bold ile işaretlediğim yerde hata gözüküyor. Var mıdır bir üstad bunu çözebilecek?
if ($post_title=='' OR $post_cat=='null' OR $post_author=='' OR $post_keywords=='' OR $post_image=='' OR $post_content=='') {
echo "<script>alert('Please fill in all the fields')</script>"; exit(); } else { move_uploaded_file($post_image_tmp,"news_images/$post_image") $insert_posts = "insert into posts (category_id,post_title,post_date,post_author,post_keywords,post_image,post_content) values ('$post_cat','$post_title','$post_date','$post_author','$post_keywords','$post_image','$post_content')";
Yazdığım kodlar aşağıdaki gibidir.
<?php
if(isset($_POST['submit'])) {
$post_title = $_POST['post_title'];
$post_date = date('m-d-y');
$post_cat = $_POST['cat'];
$post_author = $_POST['post_author'];
$post_keywords = $_POST['post_keywords'];
$post_image = $_FILES['post_image']['name'];
$post_image_tmp = $_FILES['post_image']['tmp_name'];
$post_content = $_POST['post_content'];
if ($post_title=='' OR $post_cat=='null' OR $post_author=='' OR $post_keywords=='' OR $post_image=='' OR $post_content=='') {
echo "<script>alert('Please fill in all the fields')</script>";
exit();
}
else {
move_uploaded_file($post_image_tmp,"news_images/$post_image")
$insert_posts = "insert into posts (category_id,post_title,post_date,post_author,post_keywords,post_image,post_content) values ('$post_cat','$post_title','$post_date','$post_author','$post_keywords','$post_image','$post_content')";
$run_posts = mysql_query($insert_posts);
if(mysql_query($run_posts)) {
echo "<script>alert('Post has been published!'"</script>;
echo "<script>window.open('insert_post.php','self')</script>";
}
}
}
?>
< Bu mesaj bu kişi tarafından değiştirildi akilyolu. -- 6 Aralık 2015; 23:28:30 >