Jump to content

[SOLVED] Basic HTML (IMG) in PHP?


Kibit

Recommended Posts

Wonder if any of you kind people could help me please...

 

I currently have this code...

 

<?php

$now = date("D_H:00"); 

//snip
$shows['Thu_04:00']['title']="4am till 5am Show";
$shows['Thu_05:00']['title']="<img src="/images/now%20playing%20scroller%20images/auto_gman_next.gif" width="150" height="30" />";
//snip


echo $shows[date("D_H:00")]['title'];  


?>

 

Which works fine for the 4am line as its plain text, but gives me a parse error for the 5am line as I've tried to insert some simple html to show an image.

 

Is there a bit of php code I can use instead of the html line so i don't get this parse error?

Link to comment
https://forums.phpfreaks.com/topic/103696-solved-basic-html-img-in-php/
Share on other sites

Replace your %20 with _ because PHP is trying to read it as a mathmatical eqation and/or take out all those " lol

 

<?php

 

$now = date("D_H:00");

 

//snip

$shows['Thu_04:00']['title']="4am till 5am Show";

$shows['Thu_05:00']['title']="<img src='/images/now%20playing%20scroller%20images/auto_gman_next.gif' width='150' height='30' />";

//snip

 

 

echo $shows[date("D_H:00")]['title']; 

 

 

?>

 

OR

 

<?php

 

$now = date("D_H:00");

 

//snip

$shows['Thu_04:00']['title']="4am till 5am Show";

$shows['Thu_05:00']['title']="<img src='/images/now_playing_scroller_images/auto_gman_next.gif' width='150' height='30' />";

//snip

 

 

echo $shows[date("D_H:00")]['title']; 

 

 

?>

 

 

:) both should work

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.