- 分享
- 0
- 人气
- 0
- 主题
- 99
- 帖子
- 737
- UID
- 154044
- 积分
- 106
- 阅读权限
- 13
- 注册时间
- 2008-7-13
- 最后登录
- 2013-3-21
- 在线时间
- 787 小时
|
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Upload an image</title>
- </head>
- <body>
- <[quote]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Upload an image</title>
- </head>
- <body>
- <form action="index.php" method="POST" enctype="multipart/form-data">
- File:
- <input type="file" name="image"> <input type="submit" value="Upload">
- </form>
- <?php
- //connect to database
- mysql_connect("localhost","root","") or die(mysql_error());
- mysql_select_db("databaseimage") or die(mysql_error());
- //file properties
- $file = $_FILES['image']['tmp_name'];
- if (!isset($file))
- echo "Please select an image.";
- else
- {
- $image = file_get_contents($_FILES['image']['tmp_name']);
- $image_name = $_FILES['image']['name'];
- $image_size = getimagesize($_FILES['image']['tmp_name']);
- if ($image_size==FALSE)
- echo "That's not an image.";
- else
- {
- }
- }
- ?>
- </body>
- </html>
- 想问下怎么样解决这个问题??{:4_351:}
- [/quote]form action="index.php" method="POST" enctype="multipart/form-data">
- File:
- <input type="file" name="image"> <input type="submit" value="Upload">
- </form>
- <?php
- //connect to database
- mysql_connect("localhost","root","") or die(mysql_error());
- mysql_select_db("databaseimage") or die(mysql_error());
- //file properties
- $file = $_FILES['image']['tmp_name'];
- if (!isset($file))
- echo "Please select an image.";
- else
- {
- $image = file_get_contents($_FILES['image']['tmp_name']);
- $image_name = $_FILES['image']['name'];
- $image_size = getimagesize($_FILES['image']['tmp_name']);
- if ($image_size==FALSE)
- echo "That's not an image.";
- else
- {
- }
- }
- ?>
- </body>
- </html>
- 想问下怎么样解决这个问题??{:4_351:}
复制代码 |
|