Welcome, Guest. Please login or register.
Did you miss your activation email?
July 09, 2008, 09:31:55 am
42751 Posts in 8091 Topics by 17932 Members
Latest Member: codder
Turk-Php.Com Forum  |  Yardım Forumları  |  PHP Yardım Forumu  |  base64 ile veritabanında resim saklama « previous next »
Pages: [1] Print
Author Topic: base64 ile veritabanında resim saklama  (Read 194 times)
phptr
PHP Öğrencisi
*
Offline Offline

Posts: 55


View Profile
base64 ile veritabanında resim saklama
« on: March 30, 2008, 06:44:07 am »

Code:
$pmesaj =  $_POST["mesaj"];
$resim = base64_encode($_POST["resim"]);
$tarih = gmdate("d-m-Y");
/* Resim yükleme */
$veriekle = "INSERT INTO haber (hid, baslik, haber, resim, tarih) VALUES ('','$pbaslik','$pmesaj','$resim','$tarih')";

bu kodla post edilen resmi saklıyorum..
Code:
<?
require "../ayarlar.php";

$sql = "SELECT resim FROM haber ";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
$image = $row[0];
$bas =  base64_decode($image);
?>


<?
header(" Content-Type: image/jpeg");
?>
<img src="<?=$bas;?>"  border="0" alt="">

bu kodlada okutmaya çalışıtım am çalıştıramadım ne yazıkki resimin tablosu longblob ve enctype="multipart/form-data" formdada bu var
Logged
deja_wu
Günay Yılmaz
PHP Stajyeri
**
Offline Offline

Posts: 275



View Profile WWW
Ynt: base64 ile veritabanında resim saklama
« Reply #1 on: March 30, 2008, 07:07:55 am »

Code:
<?
require "../ayarlar.php";

$sql = "SELECT resim FROM haber ";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
$image = $row[resim];
$bas =  base64_decode($image);
?>


<?
header(" Content-Type: image/jpeg");
?>
<img src="<?=$bas;?>"  border="0" alt="">

şeklinde deneyin
Logged

In the dark future, dark planet of dark people. DarkLords will rule

Jabber İletişim : deja_wu@member.turk-php.com
phptr
PHP Öğrencisi
*
Offline Offline

Posts: 55


View Profile
Ynt: base64 ile veritabanında resim saklama
« Reply #2 on: March 30, 2008, 09:26:37 am »

base64 ile saklamak mantıksız geldi bende copy ile dizinde saklamaa karar verdi Veritabanını şişiriyor çünkü

teşekkürler ilginiz için
Logged
deja_wu
Günay Yılmaz
PHP Stajyeri
**
Offline Offline

Posts: 275



View Profile WWW
Ynt: base64 ile veritabanında resim saklama
« Reply #3 on: March 30, 2008, 10:24:07 am »

neden resmi saklamaya çalışıyorsunuz ?
Logged

In the dark future, dark planet of dark people. DarkLords will rule

Jabber İletişim : deja_wu@member.turk-php.com
phptr
PHP Öğrencisi
*
Offline Offline

Posts: 55


View Profile
Ynt: base64 ile veritabanında resim saklama
« Reply #4 on: March 30, 2008, 02:54:06 pm »

base64 nasıl yapıyor bu işi denemek istemiştim..

merak sadece
Logged
engin
Admin
*
Offline Offline

Posts: 496



View Profile
Ynt: base64 ile veritabanında resim saklama
« Reply #5 on: March 30, 2008, 04:44:56 pm »

hem base64 hemde resim, veritabanı sunucusu çok iyi heralde? Smiley
Logged

Engin Dumlu
engin ~ turk-php.com
achilles ~ member.turk-php.com
Pages: [1] Print 
« previous next »
Jump to: