put_pic.php
*****************
<?php
$Connid=@mysql_connect("localhost","root","Admin");
//$info=n12br($info);
$info=nl2br($info);
//if($pic != "none")
if(!empty($pic))
{
$fp=fopen($pic,"r");
$data=addslashes(fread($fp,filesize($pic)));
}
$filesize=filesize($pic);
$filetype=filetype($pic);
$filename=basename($pic);
$date=date("Y-m-d H:i;s");
$query="insert into photo(info,name,time,pic,filename,filesize,filetype)
    values 
('$info','$name','$date','$data','$filename','$filesize','$filetype')";
if(mysql_db_query("photo",$query))
{header("Location:photo.php");}
?>

解决方案 »

  1.   

    phpto_info.php
    *******************
    <?php
    $Connid = @mysql_connect("localhost","root","Admin");
    $query = "select * from photo where id = '$id'";
    $result = mysql_db_query("photo",$query);
    /*
    $ftitle = mysql_fetch_row($result,0,"name");
    $ftime = mysql_fetch_row($result,0,"time");
    $finfo = mysql_fetch_row($result,0,"info");
    $fid = mysql_fetch_row($result,0,"id");
    $filetype = mysql_fetch_row($result,0,"filetype");
    $filetype = mysql_fetch_row($result,0,"filesize");
    $filename = mysql_fetch_row($result,0,"filename");
    */
    $ftitle = @mysql_result($result,0,"name");
    $ftime = @mysql_result($result,0,"time");
    $finfo = @mysql_result($result,0,"info");
    $fid = @mysql_result($result,0,"id");
    $filetype = @mysql_result($result,0,"filetype");
    $filetype = @mysql_result($result,0,"filesize");
    $filename = @mysql_result($result,0,"filename");
    ?>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html charset=gb2312">
    <meta name="Generator" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>相片集--
    <?php
    echo $ftitle;
    ?>
    </title>
    <style>
    A{text-transform:none;color:#000000;text-decoration:none;font-weight:normal;}
    a:hover{text-decoration:underline;color:#0000ff}
    </style>
    <link rel="stylesheet" href="" type="text/css">
    <link rel="stylesheet" href="" type="text/javascript">
    </head>
    <body topmargin="0" leftmargin="0" bgcolor="#ffffff">
    <div style="position:absolute;top:0;align=center:0;height:0;left:0;width:0">
    <table border="0" cellpadding="0" cellspacing="0" width="778">
    <tr>
    <td width="175" bgcolor="#9fcf6f" height="330" valign="top" align="center">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" height="40"></td>
    </tr>
    <tr>
    <td width="100%" align="center"><img border="0" src="yi3.jpg" width="140" height="56"></td>
    </tr>
    </table>
    </td>
    <td width="1" bgcolor="#2f8f2f" height="330"><spacer type="block" height="1"></spacer></td>
    <td width="602" valign="top" bgcolor="#deefcf" align="center">
    <table border="0" cellpadding="0" cellspacing="0" width="565">
    <tr>
    <td width="565" height="20"></td>
    </tr>
    <tr>
    <td width="565" class="NT9W" align="center">
    <a href="index.php">首?</a>|
    <a href="index_copy.php">?事</a>|
    <a href="school.php">網事</a>|
    <a href="city.php">時空</a>|
    <a href="index_fwsz.htm">服務</a>|
    <a href="index_foster.php">培?</a>|
    <a href="index.php3">?壇</a>|?壇
    </td>
    </tr>
    <tr>
    <td bgcolor="#2f8f2f" width="565" height="1"></td>
    </tr>
    </table>
    <br>
    <table border="0" cellpadding="2" width="520" class="NT9">
    <tr>
    <td width="520" bgcolor="#9fcf6f" colspan="2" align="center">相片集</td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $ftitle;?>
    </td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $filename;?>
    </td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $filesize;?>
    </td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $filetype;?>
    </td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $ftime;?>
    </td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" valign="top" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php ?>
    <img src="show.php?table=photo&id=<?php echo $id;?>" width="300" align="middle"></a></td>
    </tr>
    <tr>
    <td width="60" bgcolor="#c2e0a5" class="NT9" align="center">標題</td>
    <td width="460" class="NT9" bgcolor="#c2e0a5">
    <?php echo $finfo;?>
    </td>
    </tr>
    </table>
    <table border="0" cellpadding="0" cellspacing="0" width="565">
    <tr>
    <td bgcolor="#2f8f2f" height="1"><spacer type="block" height="1"></spacer></td>
    </tr>
    <tr>
    <td align="center"><span class="NT9">網站?介|廣告服務|幫助信息|?繫我?|Email<br><font color="#666666">Copyright &copy;All right reserved.www.hao123.com版權所有</font></span></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>
    </body>
    </html>
      

  2.   

    show.php
    ***************
    <?php
    $Connid=@mysql_connect("localhost","root","Admin");
    $sql="select pic from $table where id=$id";
    $result=mysql_db_query("photo",$sql);
    //$image=mysql_result($result,0,"pic");
    $image=mysql_query($sql);
    echo $image;
    ?>
      

  3.   

    搞笑,你贴堆HTML代码上来.想让人帮你看什么?图片显示不出来.从数据库读出后送出关用header送http头,指定MIME类型.
      

  4.   

    photo.php
    ***************
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html charset=gb2312">
    <meta name="Generator" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>相片集</title>
    <style>
    A{text-transform:none;color:#000000;text-decoration:none;font-weight:normal;}
    a:hover{text-decoration:underline;color:#0000ff}
    </style>
    <link rel="stylesheet" href="" type="text/css">
    <link rel="stylesheet" href="" type="text/javascript">
    </head>
    <body topmargin="0" leftmargin="0" bgcolor="#ffffff">
    <div style="position:absolute;top:0;align=center:0;height:0;left:0;width:0">
    <table border="0" cellpadding="0" cellspacing="0" width="778">
    <tr>
    <td width="175" bgcolor="#9cf6f" height="330" valign="top" align="center">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" height="40"></td>
    </tr>
    <tr>
    <td width="100%" align="center"><img border="0" src="yi3.jpg" width="140" height="56"></td>
    </tr>
    </table>
    </td>
    <td width="1" bgcolor="#2f8f2f" height="330"><spacer type="block" height="1"></spacer></td>
    <td width="602" valign="top" bgcolor="#deefcf" align="center">
    <table border="0" cellpadding="0" cellspacing="0" width="565">
    <tr>
    <td width="656" height="20"></td>
    <tr>
    <td width="565" class="NT9W" align="center">
    <a href="index.php">忑?</a>|
    <a href="index_copy.php">?岈</a>|
    <a href="school.php">鋒岈</a>|
    <a href="city.php">諾</a>|
    <a href="index_fwsz.htm">督</a>|
    <a href="index_foster.php">鑠?</a>|
    <a href="index.php3">?</a>|?
    </td>
    </tr>
    <tr>
    <td bgcolor="#2f8f2f" width="565" height="1"><spacer type="block" height="1"></spacer></td>
    </tr>
    </table>
    <br>
    <table border="0" cellpadding="0" width="520" class="NT9" height="288">
    <tr>
    <td width="520" bgcolor="#9fcf6f" colspan="3" align="center" height="16">眈摩</td>
    </tr>
    <?php
    if($offset == "")
    {$offset = 0;}
    $Connid = @mysql_connect("localhost","root","Admin");
    $sql = "select id,name from photo order by id desc limit $offset,6";
    $result = mysql_db_query("photo",$sql);
    //$num = mysql_num_rows($result);
    $num = @mysql_num_rows($result);
    if($num != "")
    {
    $i = 0
         while($r = mysql_fetch_array($result))
         {
         $id = $r["id"];
         $ftitle = $r["name"];
         if($i == 0 or $i == 3)
         {
         echo "<tr>";
         }
         echo "<tr width=165 bgcolor=#c2eoa5 class=NT9 align=center height=126>";
         echo "<a href=photo_info.php?id=$fid>";
         echo "show.php?table=photo&id=$fid";
         echo "height=60></a>";
         echo "<a href=photo_info.php?id=$fid>";
         echo "<p>$ftitle</p></a></td>";
         if($i == 2 or $i == 5)
         {echo "<tr>";}$i++;
         }
    }
    ?>
    </table>
    <br>
    <table border="0" cellpadding="0" cellspacing="0" width="565">
    <tr>
    <td bgcolor="#2f8f2f" height="1"><spacer type="block" height="1"></spacer></td>
    </tr>
    <tr>
    <td align="center"><span class="NT9"><span class="NT9">鋒桴?賡|豢督|翑陓洘|?霖扂?|Email<br><font color="#666666">Copyright &copy;All right reserved.www.hao123.com唳垀衄</font></span></span>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>
    </body>
    </html>
      

  5.   

    那你说说show.php页面如何修改?
      

  6.   


    在echo 之前

    Header("Content-type:image/jpeg"); 
      

  7.   

    但是在photo.php当中无法显示图片出来并且点击进入photo_info.php也无法显示
      

  8.   

    你的ID有传过去吗?
    看你代码,$_GET都没有用.你的Register_global是开着的?
      

  9.   

    但是在photo.php当中无法显示图片出来并且点击标题或图片也无法进入photo_info.php显示
      

  10.   

    你连GET都没有用.怎么获取ID?
    莫非register_global=on?
      

  11.   

    phpto_info.php 贴你的这个文件的出错提示。。
      

  12.   

    在photo.php当中无法显示图片出来
    并且点击标题或图片也无法进入photo_info.php
    photo_info.php页面无法显示出图片的具体信息。只有http://localhost/html/photo_info.php?id=
    找不到页面
      

  13.   

    图片ID找不到,看看数据库里有没有这个图片ID。
    你贴这么多东西没人看的。
    或者你找本书先看看了解一下怎么问问题再来问。