用输入栏更新图像src。 [英] Update image src with input field.?

查看:69
本文介绍了用输入栏更新图像src。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < input type =urlname =image1/> 

< input type =urlname =image2/>

< input type =urlname =image3/>

和三张图片标记。

 < img src =来自第一个输入的图片链接/> 

< img src =来自第二个输入的图片链接/>

< img src =来自第三个输入的图片链接/>

我可以用php做什么?并且使用一些条件例如我只想改变一个图像src比其他src代码没有改变我的意思是只更新一个图片。

解决方案

简单的方法:

 < img src =来自第一个输入的图片链接/> 

变为

 < img src =< php echo $ _GET ['image1']]?>/> 

假设您的表单使用get


Three url input fields.

<input type="url" name="image1"/>

<input type="url" name="image2"/>

<input type="url" name="image3"/>

And three images tag.

<img src="Image link from first input"/>

<img src="Image link from second input"/>

<img src="Image link from third input"/>

Can i do that with php.?and use some condition for example if i want only change one image src than other src code not change i mean just update only one image.

解决方案

the simple way:

<img src="Image link from first input"/>

becomes

<img src="<php echo $_GET['image1']]?>"/>

assumes your form uses get

这篇关于用输入栏更新图像src。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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