Jump to content

HELP! Only displays with Safari and IE, not with Chrome or Firefox.


freakstyling

Recommended Posts

Hi guys,

 

I´m having huge problems with my .php . Spend already a couple of days messing with the code, but can´t get it solved. When I use IE or Safari, the script works correctly and everything is displayed like it should. But not with Chrome or Firefox.

 

This is the .php code:

 

<?php

$query="SELECT *

FROM NEW

WHERE lang = '$_lang'

AND visible = '1'

ORDER BY sort DESC";

 

$result = mysql_query($query,  $conexion);

while ($row = mysql_fetch_array($result, $result_type = MYSQL_NUM))

{

echo "<h2>$row[1]<span class='black'>"." ".$row[2]."</span></h2>

  <hr class='red'>

  <div class='newsitem'>

<div class='image'>

<a href='new.php?new=$row[0]&parties=1'><img src='$row[7]?r=$_version'></a>

</div>

 

<div class='text'>$row[9]</div>

 

<div class='more'>

<a href='new.php?new=$row[0]&parties=1'>READ MORE</a>

</div>

 

<div class='clear'></div>

  </div>";

}

?>

 

Can someone already see any mistakes in this, or should I post more?

 

Thank you very much for your help!

Laurens

Link to comment
Share on other sites

Thank you for your reply´s!

 

the <hr class='red'> is to define a red line, that´s all. I don´t know if i´m supposed to close it actually...

 

I just put my page through the validator, and yes, I get some/actually loads of errors. Is a page supposed to be completely error-free?

 

Someone has any experience with something similar, or any ideas where I should start correcting errors?

 

Thanks again!

Laurens

Link to comment
Share on other sites

the <hr class='red'> is to define a red line, that´s all. I don´t know if i´m supposed to close it actually...

 

You are supposed to close it, like this:

<hr class="red" />

 

So what exactly is not displaying properly? Is your site live so we can see it? If not, can you post screenshots of the results and the expected results?

Link to comment
Share on other sites

everything you open needs to be closed....everything.  some browsers are more tollerent of unclosed tags than others....

in html5 and xhtml hr is a self closing tag, as in <hr calss='red' /> I'm not sure about html 4.x

 

I'm just not sure why you are using a rigid <hr/> when you have divs flying about the place already.

 

also, as far as the validator goes, it's best practice to conform to the w3c standard, but if you don't it doesn't meed that your page won't work.

 

Link to comment
Share on other sites

Tags are only explicitly closed like that when using an XHTML doctype.

 

I just tested a bunch of doctypes and got the following results:

 

HTML5

Accepts both <hr> and <hr />

 

HTML 4.01 Transitional

Throws warning with <hr />

 

HTML 4.01 Strict

Throws error with <hr />

 

XHTML 1.0 Transitional, Strict, and XHTML 1.1

Throws error with <hr>

 

Nifty. I always thought the ending tag was optional for HTML 4.01.

Link to comment
Share on other sites

Loads of thank you´s for your reply´s guys!

 

I´m now fixing all the errors which gives the validator. I´ve put all the end tags on the <hr class> tags. Altough not always necessary, better to always do it, right?

Let me try to fix my problem by working out all these errors I got from validator. About using the <hr> tags, I know, better to put them in the div´s. Will do that in time...

 

Again, thanx!

Link to comment
Share on other sites

still, you would be better using a div as the color atribute  for <hr> is depreciated as of html5

 

<hr> isn't deprecated, it's just different. Instead of a horizontal rule it is now a "paragraph-level thematic break".

I never said <hr> was depreciated, just that the color attribute for it was...

 

Ah, my bad then.

Link to comment
Share on other sites

Alright, back to why I actually started this topic. Solved loads of errors, and had a good look at the rest, but don´t think I can solve my problem by working all these errors out.

 

Link is: www.ushuaiaibiza.com , have a look... in IE and on mac, you´ll get to see the news item, but not in Chrome or Firefox. Anyone has an idea?!

 

Thanks again!

Link to comment
Share on other sites

Very strange... I´ve tried changing the username and password, just to be sure. Also adding the port after the localhost. Still worked in IE, but not in the rest. I´m also working on win7, and have the latest versions of the browsers. Strange your IE doesn´t show.

 

Also tried to put nothing as username and password, just ´root´, but then it didn´t do anything. Also not in IE, so it isn´t cache, otherwise it would display, even though it couldn´t get anything from the database.

 

 

What´s the best way to check the database?

 

Thanks again for the help!

Link to comment
Share on other sites

Something like

$query="SELECT *
                     FROM NEW
                     WHERE lang = '$_lang'
                     AND visible = '1'
                     ORDER BY sort DESC";
                     
               $result = mysql_query($query,  $conexion);
               while ($row = mysql_fetch_array($result, $result_type = MYSQL_NUM))
               {
                     echo '<pre>' . print_r($row, true) . '</pre>';
               }

Link to comment
Share on other sites

IT´S SOLVED!!!

 

The problem was that i´ve got all the posts set on language. My IE was displaying the spanish version, which was in the database. The rest the english version, which wasn´t in the database.

 

So now a favor, if anyone has time, could you go to ushuaiaibiza.com to see if the news item comes up. Also press it to see if the link works. Btw the text is in spanish.

 

And Thank You Very Much For The Help! You´re Great!!! All of you!

 

If I have another problem, I know where to post...

 

Cheers! I´m so happy it works!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.