0

So im trying to build me a website, using php mysql. The following code produces a logo on the site.

<img src='assets/img/<?php echo $bedrijfslogo; ?>' alt='...' />

Where the $bedrijfslogo variable is filled earlier. i know the variable is filled and not null because the logo renders in Chrome, but refuses to render in IE and FF , since there is no value.

When looking at the source in IE, i can see that the variable IS empty?

<img src="assets/img/" alt="..." />

When looking at the source in Chrome there IS a value...

<img src='assets/img/veey2.png' alt='...' />

WTF am i doing wrong here? :/

4

4 回答 4

1

Since PHP is a server-sided programming language it is in theory impossible to not see a variable in Internet Explorer and see it in Chrome.

I suspect you're HTML is incorrect and/or the filename contains an invalid character, something like:

<img src='assets/img/filename'.png' />

Notice the ' char.

It can be that the WebKit engine (Chrome) will render it anyway and the MSIE engine (Internet Explorer) won't.

-- Besides, is the same as

于 2013-05-29T10:25:08.797 回答
0

try this,

<img src='assets/img/<?=$bedrijfslogo?>' alt='...' />

let me know its helpfull or not?

于 2013-05-29T10:19:17.593 回答
0

Where the $bedrijfslogo variable is filled earlier.

Have you checked that it exists/has a value?

In the comments you said that you populate this variable in a select statement with where email = '".$_SESSION['username'] - so if there's difference across browsers, I would assume that your session is simple not working, most likely because of the session id cookie not accepted by some browsers.


If the above is the case, PHP would have warned you already, if you only had set your error reporting to a sensible debugging value - so please do that now!

于 2013-05-29T10:38:13.227 回答
0

There was no problem at all. If i had taken a minute and breath, i would have seen that the variable is filled based upon if your logged in or not, the difference was that in one browser i was logged in, and in the others i wasnt...... ASHAMED

于 2013-06-24T11:08:18.200 回答