Click to See Complete Forum and Search --> : Can not remove spacing caused by php
danpoulton
04-10-2008, 08:10 AM
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
stephan.gerlach
04-10-2008, 08:23 AM
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
danpoulton
04-10-2008, 09:52 AM
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.
stephan.gerlach
04-10-2008, 10:12 AM
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.
danpoulton
04-10-2008, 10:30 AM
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!
artemis
04-10-2008, 01:46 PM
I think you may be right about different php outputs.
When I looked at the source for index.php I saw:
<!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:
<!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?
danpoulton
04-11-2008, 11:01 AM
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
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.