【问题标题】:Store images from mercury server into database将图像从水星服务器存储到数据库中
【发布时间】:2011-10-15 06:43:10
【问题描述】:

我在数据库中创建了以下“产品”表。有一个表格用于输入将存储在“产品”表中的产品详细信息。问题是当我单击“浏览”按钮选择图像时,它看不到从服务器中选择图像的选项。任何机构都可以帮助我吗?

CREATE TABLE products 
( product_id integer unsigned auto_increment PRIMARY KEY,
  category varchar(15) NOT NULL,        
  image varchar(25) NOT NULL,     
  description varchar(50) NOT NULL
);

   <form >
   Product Category:
   <select name="category" >
   <option value="rings">Rings</option>
   <option value="earrings">EarRings</option>
   <option value="pendants">Pendants</option>
   </select>
   Product Image<input type="file" name= "image" size="15" /> 
   Product Description:<input type="text" name= "description" size="15"/> 
   <input name="submit" type="button" onClick="newproduct ('newproduct.php','info',category.value,image.value,description.value)"  value = "Submit" /> 
  </form>

【问题讨论】:

    标签: mysql html


    【解决方案1】:

    为什么不能使用 POST 发布数据,然后在第二个表单/脚本中处理它?

    【讨论】:

    • 问题是当我单击浏览按钮以选择图像时......对话框在桌面等窗口中打开,但我不知道如何从服务器上的图像文件夹中获取图像
    • 也许我没有完全明白这一点,但我认为它会在操作系统上寻找文件系统(因为 html 标签是文件)。所以据我所知这是不可能的。对不起:(
    • bytes.com/topic/javascript/answers/… 这可能会有所帮助
    猜你喜欢
    • 2019-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-09
    • 1970-01-01
    • 2013-07-01
    • 2010-12-27
    • 2012-01-21
    相关资源
    最近更新 更多