登录 | 注册 | FAQ
Anonymous

Loading an image using URL variable

+ 发表回复

3 篇帖子 分页: 1 / 1


Loading an image using URL variable

ksoftlabs » 周六 1月 24, 2015 5:15 pm

I want to load a diffrent images to a web page according to receiving url. I used following code but seems like its not working. Any help is apprecitaed

代码: 全选
<?php
   
<img src="images/brooch/tumb/".$_GET["id"].".jpg"

?>
头像

ksoftlabs

  • 帖子: 1
  • 注册: 周六 1月 24, 2015 5:10 pm

Re: Loading an image using URL variable

XainPro » 周日 2月 08, 2015 7:59 pm

try it like this



<img src="images/brooch/tumb/<?=$_GET["id"]?>.jpg">

but it's not secure programing technique !
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm

Re: Loading an image using URL variable

jasrosa » 周二 5月 05, 2015 5:00 pm

代码: 全选
<?

$_GET['id'] = $id
$path = "images/folder/
echo '<img src="'.$path'.$id.'.jpg">';

?>

But in variable path type your path to photos folder with "/" on end.
头像

jasrosa

  • 帖子: 1
  • 注册: 周二 5月 05, 2015 4:55 pm


+ 发表回复

分页: 1 / 1