PHP Link Bug

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: PHP Link Bug

Post by seandisanti » Thu Mar 28, 2013 10:30 pm

if you were manually writing your markup instead of echoing it out; wouldn't you close your image tags with greater than signs?

Code: Select all

          echo('<img src="/images/its_a_boy.jpg"');//see what i mean?
 

swarups
New php-forum User
New php-forum User
Posts: 20
Joined: Tue Mar 06, 2012 11:05 pm

Re: PHP Link Bug

Post by swarups » Mon Apr 15, 2013 1:30 am

Hi dylanm312,

Here your image tag is not closed. So the link comes as a text. Please see the code below: :)

Code: Select all

$gender = $_POST['gender'];
   

if($gender == 'Male'){
      echo('<img src="/images/its_a_boy.jpg"/>');
   }else {
      echo('<img src="/images/its_a_girl.jpg" />');
   }
   echo('<a href="/index.html">Return</a>');
Thanks
Swarup

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests