resim yolunu veritabanına yazdırma sorunu - Google Fan Webmaster Forum
Google Fan Webmaster Forum  
herşeyi sana yazdım

Geri git   Google Fan Webmaster Forum > Server Side Programlama > PHP
KEY
Kayıt ol Articles Sosyal Gruplar Forumları Okundu Kabul Et

PHP R10.net Php sevenler klubü. Kodlama soru(n)ları & acil php yardım hattı.

Cevapla
 
LinkBack Seçenekler
  1  
Alt 10-05-2011, 19:46:31
loc loc isimli üyemiz çevrimdışıdır. (Offline)
 
Standart resim yolunu veritabanına yazdırma sorunu

Merhabalar. Resim upload konusunda fazla bir bilgim yoktu. Yaptığım araştırmalar ile resim yüklemeyi başarıyla gerçekleştirdim. Ama anlamadığım kısım resim yolunu neden veritabanına kaydetmiyor?

Kodlarım şu şekilde:

PHP- Kodu:
<?php
session_start
();
if(!isset(
$_SESSION["giris"]))
{
echo 
'<font color="red">Bu sayfayi görüntüleme yetkiniz yoktur.</font>';
return;
}
?>  
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title : 'Bold text', inline : 'b'},
            {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
            {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
            {title : 'Example 1', inline : 'span', classes : 'example1'},
            {title : 'Example 2', inline : 'span', classes : 'example2'},
            {title : 'Table styles'},
            {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
        ],

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });
</script>

<!-- Biz kontrolü en altta yaptığımız için o yazı çıkıyor -->

<?php

if(empty($_POST["konu"]) || empty($_POST["aciklama"]) || empty($_POST["etiket"]) || empty($_POST["makale"]) ||  empty($_POST["alyans"])){

echo 
'
<!-- /TinyMCE -->

    <div id="breadcrumb">
        <ul>    
            <li><img src="img/icons/icon_breadcrumb.png" alt="Location" /></li>
            <li><strong>Konumunuz:</strong></li>
                <li><a href="panelim.php" title="Yönetim Paneli">Yönetim Paneli</a></li>
                            <li>/</li>
            <li><a href="panelim.php?sayfa=Makaleler" title="Makaleler">Makaleler</a></li>
            <li>/</li>
            <li class="current">Yeni Makale Ekle</li>
        </ul>
    </div>
        <div class="contentcontainer med left">
            <div class="headings alt">
                <h2>Yeni Makale Ekleme</h2>
            </div>
            <div class="contentbox">
                <form action="panelim.php?sayfa=MakaleEkle" enctype="multipart/form-data" method="POST">
                    <p>
                        <label for="textfield"><strong>Kategori:</strong></label>
                        <select name="alyans">'

include(
"ayar.php"); 

$sor=mysql_query("SELECT * FROM kategoriler"); 

while(
$yaz=mysql_fetch_array($sor)){ 

$kat_id=$yaz['kat_id']; 

$kat_baslik=$yaz['kat_baslik']; 

echo 
'<option value="'.$kat_id.'">'.$kat_baslik.'</option>'

}

echo 
'
</select> <br />
                        <span class="smltxt">(Lütfen makale için bir kategori seçiniz.)</span>
                    </p>
                    <p>
                        <label for="textfield"><strong>Başlık:</strong></label>
                        <input type="text" id="textfield" class="inputbox" name="konu" /> <br />
                        <span class="smltxt">(Lütfen makale için bir konu başlığı giriniz.)</span>
                    </p>
                    <p>
                        <label for="textfield"><strong>Açıklama:</strong></label>
                        <input type="text" id="textfield" class="inputbox" name="aciklama" /> <br />
                        <span class="smltxt">(Lütfen makale için bir açıklama giriniz.)</span>
                    </p>
                    </p>
                    <p>
                        <label for="textfield"><strong>Resim:</strong></label>
                        <input type="file" id="textfield" class="inputbox" name="haber_resim" /> <br />
                        <span class="smltxt">(Lütfen makale için bir resim yükleyiniz.)</span>
                    </p>
                    <p>
                        <label for="textfield"><strong>Etiketler:</strong></label>
                        <input type="text" id="textfield" class="inputbox" name="etiket" /> <br />
                        <span class="smltxt">(Makale için anahtar kelime giriniz. \"Örn.: gokhan\,yildiz\,php gibi\")</span>
                    </p>
                      <textarea class="text-input textarea" id="elm1" name="makale" rows="15" cols="80"></textarea>
                <input type="submit" name="buton" value="Kaydet" class="btn" />
                </form>         
            </div>'
;  
}else{

include(
"ayar.php"); 
        if (((
$_FILES["haber_resim"]["type"] == "image/gif")
    || (
$_FILES["haber_resim"]["type"] == "image/jpeg")
    || (
$_FILES["haber_resim"]["type"] == "image/pjpeg"))
    && (
$_FILES["haber_resim"]["size"] < 2000000))
      {
      if (
$_FILES["haber_resim"]["error"] > 0)
        {
        echo 
"<strong>Return Code:</strong> " $_FILES["haber_resim"]["error"] . "<br />";
        }
      else
        {
        echo 
"<strong>Upload: </strong>" $_FILES["haber_resim"]["name"] . "<br />";
        echo 
"<strong>Type: </strong>" $_FILES["haber_resim"]["type"] . "<br />";
        echo 
"<strong>Size: </strong>" . ($_FILES["haber_resim"]["size"] / 1024) . " Kb<br />";
        echo 
"<strong>Temp file: </strong>" $_FILES["haber_resim"]["tmp_name"] . "<br />";
    
        if (
file_exists("upload/" $_FILES["haber_resim"]["name"]))
          {
          echo 
$_FILES["haber_resim"]["name"] . " <strong>resim veritabaninda zaten kayitli.</strong>";
          }
        else
          {
          
move_uploaded_file($_FILES["haber_resim"]["tmp_name"],
          
"upload/" $_FILES["haber_resim"]["name"]);
          echo 
"<strong>Stored in:</strong> " "upload/" $_FILES["haber_resim"]["name"];
          
          
$resim_yolu="upload/".$_FILES["haber_resim"]["name"];
        
          }
        }
      }
    else
      {
      echo 
"<strong>Hatali Dosya</strong>";
      } 
$konu        mysql_real_escape_string($_POST["konu"]); 
$aciklama    mysql_real_escape_string($_POST["aciklama"]); 
$etiket        mysql_real_escape_string($_POST["etiket"]); 
$makale        mysql_real_escape_string$_POST["makale"]);
$alyans        mysql_real_escape_string$_POST["alyans"]);  
$resimyolu    =$resim_yolu;
$kontrol    mysql_real_escape_string($_GET['sayfa']); 

if (
mysql_real_escape_string($_GET['sayfa'] == 'MakaleEkle')) {   
         
        
$ekle "INSERT INTO makaleler (konu, aciklama, etiket, makale, alyans, resimyolu)values('$konu', '$aciklama', '$etiket', '$makale', '$alyans', '$resimyolu')"
        
$sonuc mysql_query($ekle); 
        echo 
"<div class=\"status success\"> 
                <p><img src=\"img/icons/icon_success.png\" alt=\"Başarılı\" /><span>Tebrikler!</span> Yeni makaleniz başarıyla eklenmiştir.</p> 
              </div>"

                         
         
header("Refresh: 2; url= panelim.php?sayfa=Makaleler"); 
    }
}

?> 
    </div>
<div style="clear:both;"></div>
__________________
whatever the answer is, you dont have it...
Alıntı ile Cevapla
Cevapla


Bookmarks

Seçenekler

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Açık



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 05:14:53.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

“İnsanların en hayırlısı, insanlara faydalı olandır”. H.Ş

Hosting by Radore Hosting

İçerik sağlayacı paylaşım sitelerinden biri olan R10.net WebMaster Forum Adresimizde 5651 Sayılı Kanun’un 8. Maddesine ve T.C.K’nın 125. Maddesine göre TÜM ÜYELERİMİZ yaptıkları paylaşımlardan sorumludur. R10.net hakkında yapılacak tüm hukuksal Şikayetler adresi ile iletişime geçilmesi halinde ilgili kanunlar ve yönetmelikler çerçevesinde en geç 1 (Bir) Hafta içerisinde R10.net yönetimi olarak tarafımızdan gereken işlemler yapılacak ve Avukatlarımız size dönüş yapacaktır.
ARGUS_OK

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252