Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problems displaying php page on opera

    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
    smallroompictures

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    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.
    Are you a Help Vampire?

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by tomws View Post
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,316
    Thanks
    29
    Thanked 280 Times in 274 Posts
    Quote Originally Posted by abushahin View Post
    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.)
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •