在使用PHP的服务器和客户端计算机上的本地系统上显示图像? [英] Show image on local system in both server machine and client machine with PHP?

查看:58
本文介绍了在使用PHP的服务器和客户端计算机上的本地系统上显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被困在涉及显示图像的两个问题上.
1.这些图像位于服务器计算机的其他驱动器上,而不是安装PHP的根文件夹中,例如,我的是"e:\ AppServ \ www",而我存储我的图像的文件夹是"d:\ Images".
2.这些图像位于客户端计算机上,例如,我想允许用户在其本地计算机上选择图像并将其显示在网页上.
将路径分配给img标签的src属性无效.
我认为问题涉及php中的绝对路径和相对路径,对吧?
你能帮我吗?请先在您自己的计算机上尝试您的代码,我对PHP还是很陌生.
您的帮助将不胜感激.
谢谢!

I am being stuck at two problems involving showing images.
1. These images are located at other drives of the server machine, not the root folder where PHP is installed, for example mine is "e:\AppServ\www" and the folder I store my images is "d:\Images".
2. These images are located at the client machine, for example I want to allow user to select an image on their local machine and display it on the webpage.
Assigning the paths to src property of img tag doesn''t work.
I think the problem concerns absolute and relative path in php, right?
Could you please help me out? Please try your code on your own machine first, I''m very new to PHP.
Your help would be appreciated.
Thank you!

推荐答案

您不能这样做.首先,直接通过ftp或您希望使用的其他任何方式,或者通过php脚本,将图像从客户端计算机上传到您的服务器.对于PHP脚本,谷歌"PHP上传图像".
You cannot do it like this. First upload the image from the client machine to your server either directly through ftp or any other way you desire or through a php script. For PHP script google "PHP upload images".


这篇关于在使用PHP的服务器和客户端计算机上的本地系统上显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆