www.webdeveloper.com
Results 1 to 7 of 7

Thread: Can not remove spacing caused by php

  1. #1
    Join Date
    Mar 2006
    Location
    London
    Posts
    155

    Can not remove spacing caused by php

    I have spacing on my HTML page caused by some PHP code.

    http://www.cheatserve.co.uk/demo/

    the code used can be found - http://cheatserve.co.uk/source/index.php (which uses both http://cheatserve.co.uk/source/config.php and http://cheatserve.co.uk/source/cheatserve.php)

    On the demo page you will notice white space at the top of the page and also before the content.

    Does anyone know why there is a space and/or how to get rid of it?

    Thanks

  2. #2
    Join Date
    Jan 2005
    Posts
    592
    page looks ok in firefox. but the space appears in IE. So it has nothing to do with php but more with html and css

  3. #3
    Join Date
    Mar 2006
    Location
    London
    Posts
    155
    The problem cannot be caused by CSS, the problem as you have said doesn't occur in all browsers, however my website has a template file, where all HTML is the same, which links to one CSS file.

    Also in the same browser my homepage http://www.cheatserve.co.uk - No spacing, no PHP code

    Demo site - /demo/ - Spacing PHP Code

    So i have no idea what i causing it.

  4. #4
    Join Date
    Jan 2005
    Posts
    592
    I had another look. In my opinion there is no way how php cause the line feed. The html that is send to the screen is exactly the same. So I stay with my earlier post.

    This problem seems to be an css / html problem not a php one.

  5. #5
    Join Date
    Mar 2006
    Location
    London
    Posts
    155
    i understand what you are saying, but it is not possible for the same browser to interpret two pages with the same HTML and CSS differently, the only difference between the pages is the PHP code!

  6. #6
    Join Date
    Aug 2004
    Posts
    244
    I think you may be right about different php outputs.
    When I looked at the source for index.php I saw:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Source of index.php
    </title>
    <
    meta name="description" content="The source code of index.php." />
    <
    meta name="keywords" content="source, files, cheatserve" />
    <
    link rel="stylesheet" href="../design.css" />
    </
    head>
    <
    body
    and then for the page with the error:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />??
    <
    title>?Choose a Console
    </title>?
    <
    meta name="keywords" content="" />
    <
    meta name="description" content="" />
    <
    link rel="stylesheet" href="../design.css" />
    </
    head>
    <
    body
    Notice the added '?'..
    What does the code that generates these pages look like?

  7. #7
    Join Date
    Mar 2006
    Location
    London
    Posts
    155
    The demo page has the PHP - http://www.cheatserve.co.uk/demo.

    It is my code that offer to other people and as it it quite long i'll just write the links.

    http://www.cheatserve.co.uk/source/index.php
    http://www.cheatserve.co.uk/source/config.php
    http://www.cheatserve.co.uk/source/cheatserve.php

    cheatserve.php gets code like this from my server

    PHP Code:
    <?php

    include'AUTHORISATION_FILE';

    $type $_GET['type'];


    if(
    $type == "title") {
    echo 
    'Choose a Console';
    }
    elseif(
    $type == "content") {

    $aa $_GET['aa'];
    $ab $_GET['ab'];
    $ac $_GET['ac'];
    $ad $_GET['ad'];
    $ae $_GET['ae'];
    $af $_GET['af'];

    echo 
    $aa $ac $ae '<a href="?console=3do">3DO</a>' $af $ad $ab;
    echo 
    $aa $ac $ae '<a href="?console=amiga">Amiga</a>' $af $ad $ab;



    }


    ?>
    Interesting about the question marks, i don't see them when i view the code in Firefox, what browser are you using.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles