Welcome to Dream.In.Code
Become a PHP Expert!

Join 136,933 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,857 people online right now. Registration is fast and FREE... Join Now!




Image not showing up

 
Reply to this topicStart new topic

Image not showing up

musya
22 Mar, 2008 - 07:12 PM
Post #1

D.I.C Regular
Group Icon

Joined: 25 Apr, 2007
Posts: 291



Thanked: 1 times
Dream Kudos: 50
My Contributions
Im not sure if this is php specific or not but I cant get a background image to show up in firfox or anything else like safari, but it DOES show up in IE,

here is the line of code
CODE

      <table align="center" id="top_table">
        <tr>
            <td id="header" style="width:750px; height:50px; background-image:url(<? echo "$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/images/header.png" ?>); background-repeat: no-repeat; width: 750px; height: 50px;">
                <? mosLoadModules ( 'header' ); ?>
            </td>
        </tr>
       </table>


Its a joomla template im building and the link is correct and in IE it shows up but everywhere else it doesnt, can anybody help me out? and tell me what it is? what am I missing?

Thanks you guys,
Musya
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Image Not Showing Up
22 Mar, 2008 - 07:14 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,495



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
1.) Can you verify that Globals is set, & contains the expected value?
2.) Try adding a semi-colon to the end of your echo statement.

CODE

<td id="header" style="width:750px; height:50px; background-image:url(
<?php
   if($GLOBALS[mosConfig_live_site] != "") { // replace with expected value...
     echo $GLOBALS[mosConfig_live_site]."/templates/".$GLOBALS[cur_template]."/images/header.png";
   }
   else {
     echo "Global values is set to ".$GLOBALS[mosConfig_live_site];
   }
?>
); background-repeat: no-repeat; width: 750px; height: 50px;">

User is online!Profile CardPM
+Quote Post

musya
RE: Image Not Showing Up
22 Mar, 2008 - 10:48 PM
Post #3

D.I.C Regular
Group Icon

Joined: 25 Apr, 2007
Posts: 291



Thanked: 1 times
Dream Kudos: 50
My Contributions
QUOTE(no2pencil @ 22 Mar, 2008 - 08:14 PM) *

1.) Can you verify that Globals is set, & contains the expected value?
2.) Try adding a semi-colon to the end of your echo statement.

CODE

<td id="header" style="width:750px; height:50px; background-image:url(
<?php
   if($GLOBALS[mosConfig_live_site] != "") { // replace with expected value...
     echo $GLOBALS[mosConfig_live_site]."/templates/".$GLOBALS[cur_template]."/images/header.png";
   }
   else {
     echo "Global values is set to ".$GLOBALS[mosConfig_live_site];
   }
?>
); background-repeat: no-repeat; width: 750px; height: 50px;">



It's set, do you think the spaces in the template name could be it? This is reallly odd, Its the same code I use on every template I build practically, the only thing that changes is the body, but the joomla stuff is all the same....
User is offlineProfile CardPM
+Quote Post

musya
RE: Image Not Showing Up
23 Mar, 2008 - 02:44 PM
Post #4

D.I.C Regular
Group Icon

Joined: 25 Apr, 2007
Posts: 291



Thanked: 1 times
Dream Kudos: 50
My Contributions
QUOTE(musya @ 22 Mar, 2008 - 11:48 PM) *

QUOTE(no2pencil @ 22 Mar, 2008 - 08:14 PM) *

1.) Can you verify that Globals is set, & contains the expected value?
2.) Try adding a semi-colon to the end of your echo statement.

CODE

<td id="header" style="width:750px; height:50px; background-image:url(
<?php
   if($GLOBALS[mosConfig_live_site] != "") { // replace with expected value...
     echo $GLOBALS[mosConfig_live_site]."/templates/".$GLOBALS[cur_template]."/images/header.png";
   }
   else {
     echo "Global values is set to ".$GLOBALS[mosConfig_live_site];
   }
?>
); background-repeat: no-repeat; width: 750px; height: 50px;">



It's set, do you think the spaces in the template name could be it? This is reallly odd, Its the same code I use on every template I build practically, the only thing that changes is the body, but the joomla stuff is all the same....


The globals are fine, i even put in a direct link to the background and nothing.....

User is offlineProfile CardPM
+Quote Post

quim
RE: Image Not Showing Up
23 Mar, 2008 - 04:48 PM
Post #5

D.I.C Head
Group Icon

Joined: 11 Dec, 2005
Posts: 145



Thanked: 2 times
Dream Kudos: 350
My Contributions
put the embedded php inside single quote, example:
CODE
style="background-image: url( '<?php echo "image/path" . $GLOBALS['name.png']; ?> ');"


This post has been edited by quim: 23 Mar, 2008 - 04:49 PM
User is offlineProfile CardPM
+Quote Post

musya
RE: Image Not Showing Up
23 Mar, 2008 - 06:55 PM
Post #6

D.I.C Regular
Group Icon

Joined: 25 Apr, 2007
Posts: 291



Thanked: 1 times
Dream Kudos: 50
My Contributions
QUOTE(quim @ 23 Mar, 2008 - 05:48 PM) *

put the embedded php inside single quote, example:
CODE
style="background-image: url( '<?php echo "image/path" . $GLOBALS['name.png']; ?> ');"



Nope not that either, it was weird, I just started over from a previous site I built, just replaced the body is all, and it works now.... wierd it was all the same the first time too. Maybe a bad file? Thanks anyways guys.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 10:43PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month