الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عرض الصور من قاعدة البيانات

بدأه hassan777 في 12 نوفمبر 2011 · 30 رد · 7,414 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#26

انا نقلتهم زي ماهم وغيرت اسم الملفات ضبط بس لمن اجي احطه في صفحة الحفظ ماتضبط

#27

انا حورك الاكواد وشوف ايش المشكله

هذا كود حفظ البيانات مع الصوره

<?php
include_once 'data.php';
error_reporting(0);

$z=($_POST['T1']);
$m=($_POST['T2']);
$n=($_POST['T3']);
$a=($_POST['T4']);
$b=($_POST['T5']);
$c=($_POST['T6']);
$k=($_POST['T7']);
$x=($_POST['T8']);
$y=($_POST['T9']);
$r=($_POST['T10']);
$u=($_POST['T11']);
$o=($_POST['T12']);
$p=($_POST['T13']);
$v=($_POST['T14']);
$s=($_POST['T15']);
$d=($_POST['T16']);
$f=($_POST['T17']);
$g=($_POST['T18']);
$h=($_POST['T19']);
$hh=($_POST['T50']);






if ($m==0)
{
include 'dont3.php';

}
 else
{

$tbl_name="employee"; 

$query=mysql_query("INSERT INTO $tbl_name VALUES ('$z','$m','$n','$a','$b','$c','$k','$x','$y','$r','$u','$o','$p','$v','$s','$d','$g','$h','$f','$hh',0)");

$sql=mysql_query($query);


//if (!mysql_query($sql,$link))
 //{
//include 'dont3.php';
//  }
//else{


//}

//mysql_query($insertdata) or die(mysql_error());


    $filename  = $_FILES['file']['name'];   
    $nameenc   = base64_encode($filename);
    $filesize  = $_FILES['file']['size']; 
    $filepath  = $_FILES['file']['tmp_name']; 
    $filemaxS  = 100000000;
    $filetype  = $_FILES['file']['type'];
    $filetypes = array('image/jpeg','image/gif','image/png');
    $folder    = "userimages/";
    $file      = "/DBL/userimages/".$nameenc;

    if(isset($_POST['do']) and $_POST['do'] == 'Change picture')
    {
        if (empty($filename))
        {
            echo "<div class='no'>Choose File Please</div>";
        }
        elseif($filesize > $filemaxS)
        {
            echo "<div class='no'>File Larger than [$filemaxS]</div>";
        }

        else
        {
            $move = move_uploaded_file($filepath,$folder.$nameenc);

            if($move)
            {
                $changepicture = mysql_query("UPDATE employee SET image='$file' WHERE IDno='$m' ");
                if($changepicture)
                {
                    header("Location: " . $_SERVER['HTTP_REFERER']);
                }
            }

        }
    }
ob_end_flush();

mysql_close();
include 'new4.php';


}
?>

وهذا كود عرض البيانات في جدول مع الصوره

<html dir="LtR">



<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Dayim Punj Lloyd</title>
<!--mstheme--><link rel="stylesheet" href="sumi1011.css">
<meta name="Microsoft Theme" content="sumipntg 1011">

</head>

<body onload="FP_preloadImgs(/*url*/'button13.jpg', /*url*/'button14.jpg')">


<p align="center" dir="ltr"><font size="7">
<img border="0" src="123.jpg" width="146" height="79">Dayim Punj Lloyd</font></p>
<p align="center"> </p>
<p align="center"> </p>
<div align="center">
<center>

<h2>EMPLOYEE </h2>

<?PHP
include 'data.php';

$tbl_name3="employee";
$sql3="SELECT * FROM $tbl_name3";
$result3=mysql_query($sql3);


echo "<center><table border='1'>
<tr>
<th><font size=1>img</th>
<th><font size=1>NAME</th>
<th><font size=1>IDNO</th>
<th><font size=1>NATIONALITY</th>
<th><font size=1>DATE OF BIRTH</th>
<th><font size=1>ADDRESS</th>
<th><font size=1>MAIL</th>
<th><font size=1>Mobile.No1</th>
<th><font size=1>Mobile.No2</th>
<th><font size=1>TEL</th>
<th><font size=1>P.O.BOX</th>
<th><font size=1>Employee.No</th>
<th><font size=1>Ex.Residence</th>
<th><font size=1>Target Date</th>
<th><font size=1>Date Passport</th>
<th><font size=1>Date of Port ID</th>
<th><font size=1>Ex.Date Port ID</th>
<th><font size=1>DATE OF PERMISSION CAR</th>
<th><font size=1>Designation</th>
<th><font size=1>SECTION</th>
<th><font size=1>GOSI</th>
</tr>";


while($row3 = mysql_fetch_array($result3))
  {
//echo $row3[exdpp];

$x=(date("Y/n/d"));
$y=(date("$row3[exdpp]"));
$i=(date("$row3[EDR]"));
$b=(date("$row3[DP]"));
$z=(date("$row3[DPER]"));

$diff = strtotime($y) - strtotime($x); 

$diff2 = strtotime($i) - strtotime($x); 

$diff3 = strtotime($b) - strtotime($x); 

$diff4 = strtotime($z) - strtotime($x); 

$day_difference = ceil($diff / (60*60*24)) ; 
$day_difference2 = ceil($diff2 / (60*60*24)) ; 
$day_difference3 = ceil($diff3 / (60*60*24)) ; 
$day_difference4 = ceil($diff4 / (60*60*24)) ; 


$Eimage   = $row['image'];
echo "<tr>";

  if(($day_difference<=7)or($day_difference2<=15)or($day_difference3<=15))
{
echo"<font  color=red>";
 echo "   <th> <a id='open' href='#open'></a>
                <img src='$Eimage' width='60' /></th>";
  echo "<td><font size=1 color=red>" . $row3[name] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[IDno] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[nanty] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[DBirth] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[Add] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[mail] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[mobNo1] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[mobNo2] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[Tel] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[POBOX] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[Empno] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[EDR] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[DCW] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[DP] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[DPP] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[exdpp] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[DPER] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[IAD] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[Section] . "</td>";
  echo "<td><font size=1 color=red>" . $row3[GOSI] . "</td>";
  echo "</tr>";
  }
else
{
  echo "<td><font size=1>" . $row3[name] . "</td>";
  echo "<td><font size=1>" . $row3[IDno] . "</td>";
  echo "<td><font size=1>" . $row3[nanty] . "</td>";
  echo "<td><font size=1>" . $row3[DBirth] . "</td>";
  echo "<td><font size=1>" . $row3[Add] . "</td>";
  echo "<td><font size=1>" . $row3[mail] . "</td>";
  echo "<td><font size=1>" . $row3[mobNo1] . "</td>";
  echo "<td><font size=1>" . $row3[mobNo2] . "</td>";
  echo "<td><font size=1>" . $row3[Tel] . "</td>";
  echo "<td><font size=1>" . $row3[P.O.BOX] . "</td>";
  echo "<td><font size=1>" . $row3[Empno] . "</td>";
  echo "<td><font size=1>" . $row3[EDR] . "</td>";
  echo "<td><font size=1>" . $row3[DCW] . "</td>";
  echo "<td><font size=1>" . $row3[DP] . "</td>";
  echo "<td><font size=1>" . $row3[DPP] . "</td>";
  echo "<td><font size=1>" . $row3[exdpp] . "</td>";
  echo "<td><font size=1>" . $row3[DPER] . "</td>";
  echo "<td><font size=1>" . $row3[IAD] . "</td>";
  echo "<td><font size=1>" . $row3[Section] . "</td>";
  echo "<td><font size=1>" . $row3[GOSI] . "</td>";
  echo "</tr>";
}}
echo "</table>";


    echo "<div class='hideform'>";
    $filetypes = array('image/jpeg','image/gif','image/png');
    $filemaxS  = 100000000;


    foreach ($filetypes as $f)
    {
        $f = str_replace('image/','.',$f);

    }



mysql_close();
?>

<a href="rep.PHP"><h3>Back</h3></a> <pre>             <a href="HOME.PHP"><h3>HOME</h3></a> </pre>
</body>

</html>
#28

افصل حفظ الصورة عن حفظ باقي البيانات خليه زي ما هو في ملف changepicture.php

و الملف التاني فيه اخطاء منها ,

اي حاجة بالشكل ده عندك

$row3[name]

حولها لكدة

$row3['name']

بين اقواس

و انا اسف جدا جدا جدا هنا انا هقفل و القاكم علي خير يوم السبت ان شاء الله.

@My Twitter

[spacing]

EGYPT

[/spacing]

#29

ماقصرت كفين ووفيت يعطيك الف عافيه ومشكوووووووووووووووووووور

#30

تمام الحمد لله انها اشتغلت معاك كويس و بالتوفيق دايما ان شاء الله ,

وما تنساش الدعاء بئي .

تم تعديل هذه المشاركة بواسطة HUSSEin-AHMeD في 18 نوفمبر 2011 في 16:21

@My Twitter

[spacing]

EGYPT

[/spacing]

#31

اكيد طبعا ومره ثانيه الف شكر

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…