-1

in my project I want to add image to show the link in which the my code is return image if I use

 <a href="<?= site_url('login')?>">
     <img src="<?= base_url();?>images/login.png" 
          width="32" 
          height="32" 
          border="0" />
 </a>

echo in php but when I use this it is not able to return image insead what is the method of base path.

 <a href="<?php echo site_url('login')?>">
     <img src="<?php  echo base_url();?>images/login.png" 
          width="32" 
          height="32" 
          border="0" />
 </a>
Cœur
  • 37,241
  • 25
  • 195
  • 267
Smoke
  • 89
  • 1
  • 8
  • 15

2 Answers2

2

If your image path is correct try this

 <a href="<?= site_url('login')?>">
     <img src="<?php echo base_url('images/login.png');?>" 
          width="32" 
          height="32" 
          border="0" />
 </a>

And see http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html

Gordon
  • 312,688
  • 75
  • 539
  • 559
Lal krishnan S L
  • 1,684
  • 1
  • 16
  • 32
0

you could try this if your image path is right

<img src="../images/login.png"/>
Kedar B
  • 774
  • 5
  • 18
  • 47