...

View Full Version : problems displaying php page on opera



abushahin
11-22-2009, 03:25 PM
Hey jus wondered if anybody could spot an obvious mistake or if im doing something wrong as my page wont display on the opera browser its fine on all other browsers including windoze, im using v 9.62, the codes below:

<?php echo "<xml version=\"1.0\" encoding=\"UTF-8\"/>\n"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Blogs Start Page</title>
<link rel='stylesheet' type='text/css' href='style.css' />
<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]>
<link rel='stylesheet' type='text/css' href='multi-column-ie.css' />
<script src="/ie7/ie7-standard-p.js" type="text/javascript"></script>
<![endif]-->
</head>
<body>
<div id='header'>
<h1 style="text-align:center">Welcome To Your Blog</h1>
<div id="navcontainer">
<ul id="navlist" style="text-align:center">
<li><a href="index.html">Home</a></li>
<li><a href="login.php">Login</a></li>
<li><a href="register.php">Register</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Links</a></li>
</ul>
</div>
</div>
<div id='container'>
<div id='first-column'>

</div>
<?php
require 'include.php';
//connect to SQL server
$conn = mysql_connect($dbHost, $dbUser, $dbPass) or die ('Error connecting to mysql');
mysql_select_db($dbName) or die('Error, cant find database');

$retrieveQuery = mysql_query("SELECT blog_Id, blog_Title, blog_Created_Datetime, user_Name, location
FROM blogs, users
WHERE blogs.user_Id = users.user_Id ORDER BY blog_Created_Datetime DESC;");
$num = mysql_num_rows($retrieveQuery);

if ($num > 0)
{
?>
<div id='content'>
<h2 style="text-align:center;text-decoration:underline;">Latest Blog Titles</h2>
<p style="text-align:center"><a href = "blogswithentry.php" style='color:#FF0000'>View blogs with entries</a></p>
<hr class="ee"/>
<?php

$i=0;
while ($i<$num) {
$blogtitle = mysql_result($retrieveQuery,$i,"blog_Title");
$blogid = mysql_result($retrieveQuery,$i,"blog_Id");
$date = mysql_result($retrieveQuery,$i,"blog_Created_Datetime");
$username = mysql_result($retrieveQuery,$i,"user_Name");
$location = mysql_result($retrieveQuery,$i,"location");
$NewDate = date("d M Y, H:i:s", strtotime($date));
?>

<p style="text-align:center;color:#CD580A">
<?php echo $blogtitle;?><br />
<?php echo "<b>By:</b> ".$username .", ". $location ." ". '<span style="font-size:x-small;color:#224433">('.$NewDate.')</span>'; ?><br />
<?php echo "<a href = blog_details.php?id=$blogid style='font-size:small;color:#FF0000'>View full blog and add comments</a>";?>
<hr class="ee"/></p>
<?php

$i++;
}
?>

<?php
}
else if ($num == 0)
{

echo "No Records Found<br />";
echo '<a href="register.php">Register to add blogs</a>';
}
?>
</div>
<div id='third-column'>

</div>
</div>
<div id='footer'>
<h6 style="text-align:center">Blogs 2009 &copy; Abu Shahin</h6>
</div>
</body>
</html>

thanks in advance abu
abushahin (http://abushahin.eu)
smallroompictures (http://smallroompictures.com)

tomws
11-22-2009, 07:19 PM
Some suggestions:
1) Wrap your code in code tags. As far as I know, the post entry form clearly states this. It makes your post readable.
2) Clearly state your problem. "my page wont display on the opera browser" is not a clear explanation.
3) Post in the appropriate forum. Browsers don't care if the page is written in PHP. They only display what a server sends, and it's the server that handles the PHP. So, the issue is unlikely to be with PHP.

Fou-Lu
11-22-2009, 08:57 PM
Some suggestions:
1) Wrap your code in code tags. As far as I know, the post entry form clearly states this. It makes your post readable.
2) Clearly state your problem. "my page wont display on the opera browser" is not a clear explanation.
3) Post in the appropriate forum. Browsers don't care if the page is written in PHP. They only display what a server sends, and it's the server that handles the PHP. So, the issue is unlikely to be with PHP.

Yes indeedy. The only thing I've seen that is PHP based that differs against different browsers was improper redirecting and how the browsers resolved them. That being said, its still not a PHP issue; its an HTTP issue.
Moving from PHP to HTML/CSS.
First thing to do is run that output through the validator at validator.w3.org. You'll find that it will complain right from line 1 which is going to lead to a lot of potential problems.

Arbitrator
11-23-2009, 05:38 AM
Hey jus wondered if anybody could spot an obvious mistake
You're missing a question mark character at the beginning of your XML declaration.
If you're serving this XHTML 1.1 document as XML, then the meta element should reflect an XML MIME type (i.e., application/xhtml+xml or application/xml).
If you're serving this document as HTML, then you should be using XHTML 1.0 or HTML 4.01 with a lang attribute in addition to the xml:lang attribute for XHTML 1.0 documents or instead of an xml:lang attribute for HTML 4.01 documents.
There's an invalid URL "#" in two href attributes.
You omitted mandatory quotation marks around an attribute value for a href attribute. (They're only mandatory in XHTML documents.)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum