Login | Register | FAQ
Anonymous

Loading an image using URL variable

+ Post a reply

3 posts Page 1 of 1


Loading an image using URL variable

by ksoftlabs » Sat Jan 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

Code: Select all
<?php
   
<img src="images/brooch/tumb/".$_GET["id"].".jpg"

?>
User avatar

ksoftlabs

  • Posts: 1
  • Joined: Sat Jan 24, 2015 5:10 pm

Re: Loading an image using URL variable

by XainPro » Sun Feb 08, 2015 7:59 pm

try it like this



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

but it's not secure programing technique !
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Loading an image using URL variable

by jasrosa » Tue May 05, 2015 5:00 pm

Code: Select all
<?

$_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.
User avatar

jasrosa

  • Posts: 1
  • Joined: Tue May 05, 2015 4:55 pm


+ Post a reply

Page 1 of 1