Facebook Sharer
选择您要替换的背景颜色:
【农历新年】背景图片:
个性化设定
 注册  找回密码
查看: 2629|回复: 1
打印 上一主题 下一主题

Read error!???

[复制链接]

99

主题

0

好友

106

积分

高级会员

Rank: 3Rank: 3Rank: 3

跳转到指定楼层
1#
发表于 2011-5-29 12:23 AM |只看该作者 |倒序浏览
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <title>Upload an image</title>
  6. </head>

  7. <body>
  8. <[quote]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  12. <title>Upload an image</title>
  13. </head>

  14. <body>
  15. <form action="index.php" method="POST" enctype="multipart/form-data">
  16.         File:
  17.         <input type="file" name="image"> <input type="submit" value="Upload">
  18. </form>
  19. <?php
  20. //connect to database
  21. mysql_connect("localhost","root","") or die(mysql_error());
  22. mysql_select_db("databaseimage") or die(mysql_error());

  23. //file properties

  24. $file = $_FILES['image']['tmp_name'];

  25. if (!isset($file))
  26.         echo "Please select an image.";
  27. else
  28. {
  29.         $image = file_get_contents($_FILES['image']['tmp_name']);
  30.         $image_name = $_FILES['image']['name'];
  31.         $image_size = getimagesize($_FILES['image']['tmp_name']);

  32.         if ($image_size==FALSE)
  33.                 echo "That's not an image.";
  34.         else
  35.         {

  36.         }
  37. }
  38. ?>
  39. </body>
  40. </html>
  41. 想问下怎么样解决这个问题??{:4_351:}
  42. [/quote]form action="index.php" method="POST" enctype="multipart/form-data">
  43.         File:
  44.         <input type="file" name="image"> <input type="submit" value="Upload">
  45. </form>
  46. <?php
  47. //connect to database
  48. mysql_connect("localhost","root","") or die(mysql_error());
  49. mysql_select_db("databaseimage") or die(mysql_error());

  50. //file properties

  51. $file = $_FILES['image']['tmp_name'];

  52. if (!isset($file))
  53.         echo "Please select an image.";
  54. else
  55. {
  56.         $image = file_get_contents($_FILES['image']['tmp_name']);
  57.         $image_name = $_FILES['image']['name'];
  58.         $image_size = getimagesize($_FILES['image']['tmp_name']);

  59.         if ($image_size==FALSE)
  60.                 echo "That's not an image.";
  61.         else
  62.         {

  63.         }
  64. }
  65. ?>
  66. </body>
  67. </html>
  68. 想问下怎么样解决这个问题??{:4_351:}
复制代码




收藏收藏0

37

主题

1

好友

2538

积分

白金长老

Rank: 10

2#
发表于 2011-5-29 12:30 AM |只看该作者
$image_name = $_FILES['image']['name'];

换取

$image_name = $_POST['image']['name'];



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-11-25 07:27 AM , Processed in 0.092445 second(s), 26 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Ultra High-performance Dedicated Server powered by iCore Technology Sdn. Bhd.
Domain Registration | Web Hosting | Email Hosting | Forum Hosting | ECShop Hosting | Dedicated Server | Colocation Services
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部