将图片保存到数据库(PHP)错误 [英] to save pictures to the database (PHP) error

查看:80
本文介绍了将图片保存到数据库(PHP)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

]ob_start();
include("top.php");
include("tabletop.php");
if ( empty($_SESSION[''nick'']) AND empty($_SESSION[''sifre'']) AND empty($_GET["ilan"]) ) {
echo "giriþ yapmadýnýz!";}else{
$ilan=$_GET["ilan"];
$sql=mysql_query("select tur from ilanayrinti$ilan where tur=''resim''");
$sayisi=mysql_num_rows($sql);
$sqla=mysql_query("update ilan set resim=$sayisi where id=$ilan");
if($sayisi<=4){
require(''ekler/fonksiyonlarim.php'');
require(''ekler/ayarlarim.php'');
$ilan=$_GET["ilan"];


function highlight(field) {
field.focus();
field.select();
}
var maxWidth=100;
var maxHeight=100;
var fileTypes=["jpg","jpeg","gif","png"];
var outImage="previewField";
var defaultPic="spacer.gif";
/***** DO NOT EDIT BELOW *****/
function preview(what){
  var source=what.value;
  var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
  for (var i=0; i<filetypes.length;>  globalPic=new Image();
  if (i<filetypes.length)>  else {
    globalPic.src=defaultPic;
    alert("BU TÜR DOSYALARI YÜKLEYEMEZSÝNÝZ!\n\nÝzin verilen dosya uzantýlarý:\n\n"+fileTypes.join(", "));
  }
  setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges(){
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth) {
    y*=maxWidth/x;
    x=maxWidth;
  }
  if (y>maxHeight) {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}

if($_POST){
require_once ('ekler/posttan.php');
}


<style type="text/css">
<!--
.style5 {color: #CCCCCC}
body,td,th {
	font-size: 10px;
}
-->
</style>
<body>
<center>
<form enctype="multipart/form-data" method="post">
<table width="400" border="0" align="center" height="704">
<tr>
<td align="center" height="1"><b></b></td></tr>
<tr>
  <td align="center" height="8">Yükleyebileceðiniz dosya türleri: .jpg, jpeg, .gif</td>
</tr>

<tr>
  <td height="20" align="center">Yüklenebilir MAXÝMUM Dosya Boyutu :
    <?php $maximum_mb = $azami / 1024 / 1024;<br mode="hold" /?>        echo number_format($maximum_mb, 2, ",", ".");?&gt;
    MB</td>
</tr>
<tr>
  <td align="center" height="21"><input name="resim" type="file" class="file" onchange="preview(this)" size="50"></input></td>
</tr>
<tr>
<select size="0" name="id" style="visibility:hidden;">
                        
                                        echo "<option value="$ilan"></option>";
                        ?&gt;
                        </select><br>
<td align="center" height="25"><input name="gonder" type="submit" class="file" value="Dosya Yolla"></input></td>
</br></tr>
<tr>
  <td height="197" align="center" valign="bottom">
        if($_POST){
if ($boyut &gt;= $azami){
uyari(''Dosyanýz çok büyük!'');
}
                        if ($resim != "" && $boyut &lt;= $azami){
$uzanti_izinlimi = ptIzinlimi($uzanti);
                                        if ($uzanti_izinlimi == ''evet''){
                                        move_uploaded_file ($_FILES[''resim''][''tmp_name''], $klasor.$yeniresim) or die (''Dosya kopyalanamýyor'');
?&gt;<table width="370" border="0" align="center" class="uyari2">
<tr>
  <td align="center" height="239"><b><a href="&lt;?=$link?&gt;" target="_blank"> <img src="&lt;?=$link?&gt;" alt="&lt;?=$link?&gt;" width="150" border="0"></img></a><br>
    Resim Boyutu =
    
    </br></b>
<br>
<strong class="footer"><b>Resmi gerçek boyutta görmek için üzerine týklayýn...<br><br></br></br></b> </strong>
                                              }
                                        if ($resimismi == ""){
                                        uyari(''Dosya Seçin Lütfen!'');
                                        }
                                        if ((!$resimismi == "")&&($uzanti_izinlimi == ''hayir'')){
                                        uyari(''Bu tür dosyalarý yükleyemezsiniz!'');
                                        }
                        }
                }
if(!$_POST){
uyari('''');
}
?&gt;</br></td>
</tr>
</table></td></tr></table></form>
include("baglanti.php");
$id=$_POST["id"];
if ($resim != "" && $boyut &lt;= $azami){
$sql="insert into ilanayrinti$id(tur,url) values(''resim'',''$link'')";
                        $kontrol=mysql_query($sql);
                        if($kontrol)
                        {
                                echo "Resim kayýt iþlemi baþarýlý þekilde yapýldý";
                                $gidilecekYer = "thumb.php?resim=$link&id=$id";
                                header ("Location: " . $gidilecekYer);
                                echo "<br>";
                        }
                        else
                        {
                                die(mysql_error());
                                echo "Resim kayýt iþlemi yapýlýrken hata oluþtu. Lütfen tekrar deneyiniz.";
                                echo "<br>";
                        }
?&gt;

                                                {{
  [B][U]                              else                 {[/U][/B]

                        echo "Son Eklediðiniz Resimde Yüklenmiþtir. Baska Resim Yükleyemezsiniz. Bir Ýlana En Fazla 5 Adet Resim Yükleyebilirsiniz. Resim Yükleme Limitiniz Dolmuþtur!";
                        }
                        include("tabloalt.php");
                        include("alt.php");
                        }


这是房地产网站",人们必须添加房屋的图片.但是[B] BOLD [/B]和[U]UNDELİNE[/U]代码有问题..

我能做些什么 ?
谢谢


this is "real estate site" and People must to add house''s picture. But [B]BOLD[/B] and [U]UNDELİNE[/U] code is problem..

what can I do ?
thanks

推荐答案

_SESSION [''nick''])和空(
_SESSION[''nick'']) AND empty(


_SESSION [''sifre'']) AND empty(
_SESSION[''sifre'']) AND empty(


_GET ["ilan"])){ echogiriþyapmadýnýz!";} else {
_GET["ilan"]) ) { echo "giriþ yapmadýnýz!";}else{


这篇关于将图片保存到数据库(PHP)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆