Jump to content

inquire() adding space to header


ThePhoenixRising

Recommended Posts

OK, so I'm making a download.php page, that if it has a id variable in the header, it requires downloadprofile.php with that variable. If not, it requires a download list. (WIP). But, for some reason, when it requires the profile, it adds space to the header on top. (See here: http://76.93.25.14:26656/FlamingDevastation/download.php?id=00000001) If i go to downloadprofile.php and use the variable, there are no extra space.

 

Here is the source for the download php:

<?php
error_reporting(0);
if ($_GET['id'] == NULL) {
echo "List of downloads";
}
else {
require("downloadprofile.php");
}
?>

 

The downloadprofile.php:

<?php
$post = "hey";
$servername = "localhost";
$user = "root";
$pass = "root";
$dbname = "FD";
$downloadid = $_GET['id'];

mysql_connect($servername, $user, $pass) or die("Could not connect to MySQL database.");
mysql_select_db("$dbname");

$downloads = mysql_query("SELECT * from download where id=$downloadid");
$file = mysql_result($downloads, 0, "file");

?>
<!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" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FD Art | Download</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="style.css" rel="stylesheet" type="text/css" />
<style>
ul.downloads a{  
display: block;  
width: 125px;  
height: 125px;  
float: left;  
margin: 0px 0px 0px 10px;  
background: url(<?php echo mysql_result($downloads, 0, "image"); ?>) no-repeat; 
text-indent: -9999px;
}
</style>
</head>
<body>
<div id="wrapper">
    	<div id="header">
        	<style type="text/css"> a { text-decoration: none; } </style>
        		 <a href="#" style="text-decoration: none;"> <p><span>www.</span>flamingdevastation<span>.com</span></p></a>
            	<ul>
                    <li class="no_bg"><a href="#">home</a></li>
                    <li><a href="#">art</a></li>
                    <li><a href="#">forum</a></li>
                    <li><a href="#">contact</a></li>
               </ul>
        </div>
        <div id="banner">
        	<img src="http://i.imgur.com/DRNh4.png" alt="" />
        </div> <!--banner ends-->
        
        <div id="navigation">
        	<ul>
            	<li><a href="index.php">Home</a></li>
                <li> <a href="#">Art</a></li>
                <li><a href="#">Forum</a></li>
                <li><a href="#">Tutorials</a></li>
                <li class="active"><a href="download.php">Downloads</a></li>
        	</ul>
                   <form id="search_form" action="search.php" method="post">
               <input onfocus="this.value=''" type="text" value="Search this website for..." />
                     <input type="submit" id="submit" value=""/>
       </form>
        </div> <!--navigation ends-->
         <!--navigation ends-->
        
        <div id="content">
       	  <div id="left_column">
       	    <div class="text">
                	<h2><?php echo mysql_result($downloads, 0, "name"); ?></h2>
                    	<p><?php echo mysql_result($downloads, 0, "description"); ?></p>
              </div> <!--text ends--><!--text ends--><!--text ends-->
            </div> 
        	<!--left column ends-->
            
          <div id="right_column">
          <div class="heading">
                
                	<h2>Download:</h2>
                </div> <!--heading ends-->
                	<ul class="downloads">
            			<a>Download</a>
            		</ul>
   		    <div id="information">
   		    <P><b>Name: </b><?php echo mysql_result($downloads, 0, "Name"); ?></P>
   		    <P><b>File Type: </b><?php echo mysql_result($downloads, 0, "type"); ?></P>
   		    <P><b>File Size: </b><?php echo mysql_result($downloads, 0, "size"); ?></P>
   		    <br />
   		    <? echo "<a href=\"downloadfiles/$file\">Download</a>"; ?>
		</div>
   		    </div> 
            <!--right column ends-->
        </div> <!--content ends-->
</div> <!--wrapper ends-->
    
    <div id="footer">
    	<div id="footer_content">
        	<ul>
        		<li class="no_bg"><a href="#">home</a></li>
                <li><a href="#">art</a></li>
                <li><a href="#">forum</a></li>
                <li><a href="#">contact</a></li>
		</ul>
            <p> © 2011 FD Art.   All Rights Reserved.</p>
    	</div> <!--footer content ends-->
    </div> <!--footer ends-->
</body>
</html>				
<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

 

And the CSS for downloadprofile.php:

ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input{
margin:0;
padding:0;
}
ul{
list-style:none;
}
fieldset{
border:0;
}
a,a:link,a:visited,a:hover{
color:#00f;
text-decoration:none;
}
a:focus,a:hover{
text-decoration:underline;
}
a img{
border:0;
}
.clear{
clear:both;
}
body{
position:relative;
background:#383d43 url(http://i.imgur.com/ILtu7.png) repeat-x;
color:#000;
font:62.5% Arial,sans-serif;
}

#header{
width: 926px;
height: 49px;
font-size: 14px;
padding-top: 16px;
padding-right: 35px;
padding-bottom: 0px;
padding-left: 22px;
}

#header p{
float: left;
color: #525961;
}

#header span{
color: #bababa;
}

#header ul{
float: right;
}

#header ul li{  
float: left;  
margin: 0px 12px 0px 0px;  
padding: 0px 0px 0px 12px;  
background: url(http://i.imgur.com/1Rw7F.gif) left bottom no-repeat;  
}  


#header ul li.no_bg{
background: none;
}

#header ul li a{
color:#fff;
}

#logo{
display: inline-block;
width: 297px;
height: 34px;
float: left;
clear: both;
margin: 0px 0px 0px 21px;
background: url(/public_html/images/images/Logo.png) no-repeat;
text-indent: -9999px;
}

form{
float: right;
margin-top: 6px;
margin-right: 12px;
}

input{
width: 198px;
height: 17px;
float: left;
padding: 5px 10px;
color: #a0a4a8;
border: none;
}

input#submit{
display: inline;
width: 66px;
height: 27px;
float: left;
margin: 0px 5px 0px 4px;
background: url(http://i.imgur.com/wOpGg.gif) no-repeat;
}

#banner{
float: left;
margin: 12px 0px 0px 0px;
}

#banner img{
float: left;
width: 940;
height: 300;
border-left: 1px solid #43474b;
border-right: 1px solid #43474b;
        border-top: 1px solid #43474b;
}

#navigation{
width: 926px;
height: 52px;
float: left;
padding: 12px 0px 0px 15px;
background: url(http://i.imgur.com/ZTX65.jpg) repeat-x;
border-left: 1px solid #43474b;
border-right: 1px solid #43474b;
border-top: 1px solid #43474b;
}

#navigation ul li{
display: block;
float: left;
height: 41px;
}

#navigation ul li a{
display: inline-block;
color: #cbd9e7;
height: 29px;
font-size: 14px;
padding: 12px 24px 0px 24px;
text-transform: uppercase;
}

#navigation ul li a:hover{
text-decoration: none;
background: url(http://i.imgur.com/hH1ZJ.gif) repeat-x;
}

#navigation ul li.active a{
background: url(http://i.imgur.com/hH1ZJ.gif) repeat-x;
}

#navigation1{
width: 926px;
height: 52px;
float: left;
padding: 12px 0px 0px 15px;
background: url(http://i.imgur.com/ZTX65.jpg) repeat-x;
border-left: 1px solid #43474b;
border-right: 1px solid #43474b;
border-top: 1px solid #43474b;
}

#navigation1 ul li{
display: block;
float: left;
height: 41px;
}

#navigation1 ul li a{
display: inline-block;
color: #cbd9e7;
height: 29px;
font-size: 14px;
padding: 12px 24px 0px 24px;
text-transform: uppercase;
}

#navigation1 ul li a:hover{
text-decoration: none;
background: url(http://i.imgur.com/hH1ZJ.gif) repeat-x;
}

#navigation1 ul li.active a{
background: url(http://i.imgur.com/hH1ZJ.gif) repeat-x;
}

#content{
width: 943px;
float: left;
background: url(http://i.imgur.com/Ljb4E.jpg) repeat-y;
}

#left_column{
width: 619px;
float: left;
border-left: 1px solid #43474b;
}

.text{
font-family: Helvetica, Arial;
width: 552px;
float: left;
padding: 32px 38px 22px 30px;
}

.text h2{
font-size: 24px;
float: left;
margin: 0px 0px 12px 0px;
color: #fff;
}

.text p{
color: #bcc4c7;
width: 552px;
float: left;
clear: left;
font-size: 12px;
}

.text p img{
float: right;
margin: 0px 0px 0px 20px;
}

.text a.continue{
position: relative;
color: #65b8f9;
float: left;
clear: left;
font-size: 15px;
margin: 30px 0px 0px 0px;
}

.alternative{
background: #2a2d32;
border-top: 1px solid #26292e;
border-bottom: 1px solid #26292e;
}

#right_column{
width: 287px;
float: left;
padding: 18px 18px 0px 17px;
}

.heading{
width: 260px;
height: 29px;
float: left;
padding: 12px 14px 0px 14px;
margin: 0px 0px 18px 0px;
background: url(http://i.imgur.com/hH1ZJ.gif) repeat-x;
}
.heading h2{
font-size: 17px;
color: #ffffff;
float: left;
font-weight: normal;
}

.heading img{
float: right;
margin: 3px 0px 0px 0px;
}

ul{
float: left;
margin: 0px 0px 39px 0px;
}

ul{  
float: left;  
margin: 0px 0px 39px 0px;  
}  
ul li{
font-size: 14px;
color: #ffffff;
margin: 0px 0px 17px 11px;
}

ul li span{
color: #65b8f9;
}

#footer{
width: 100%;
float: left;
clear: both;
height: 120px;
border-top: 1px solid #3c4249;
background: #1e2329;
}

#footer_content{
margin: auto;
width: 943px;
padding: 46px 17px 0px 0px;
}

#footer_content ul{
float: right;
margin: 0px 0px 10px 0px;
}

#footer_content ul li{
float: left;
margin: 0px 0px 0px 12px;
padding: 0px 0px 0px 12px;
background: url(http://i.imgur.com/1Rw7F.gif) left bottom no-repeat;
}

#footer_content ul li.no_bg{
background: none;
}

#footer_content ul li a{
color:#fff;
}


#footer_content p{
float: right;
clear: right;
margin: 0px;
font-size: 12px;
color: #383d43;
}
.replace{
position:relative;
margin:0;
padding:0;
/* \*/
overflow:hidden;
/* */
}
.replace span{
display:block;
position:absolute;
top:0;
left:0;
z-index:1;
}

#wrapper{
width: 943px;
padding: 0px 0px 0px 1px;
margin:0 auto;
}
#information{
width: 140px;
padding-left: 10px;
font-size: 15px;
color: #ffffff;
float: left;
font-weight: regular;
}

 

Link to comment
Share on other sites

Just to confirm: this a visual problem you are having, right? Not like an actual space right?

 

Yes, look at the link I gave: http://76.93.25.14:26656/FlamingDevastation/download.php?id=00000001

It also messes up the search bar.

 

This is what it looks like without the require:

http://76.93.25.14:26656/FlamingDevastation/downloadprofile.php?id=00000001

 

 

Link to comment
Share on other sites

did you use include instead of require for download.php ? The behavior is very peculiar.

 

Have you tried removing the white space between the doctype declaration and the closing php tag?(Kinda a long shot.)

//...?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Also, have you tried copying download.php to a new file to try and get rid of any unwanted invisible characters.

 

Also, the space is only visible in IE, top margin is offset by about 10px in Chrome (for me anyways...)

 

so source is identical in chrome(unless you view through inspect element window)....

 

I'm out of ideas on this one...

Link to comment
Share on other sites

did you use include instead of require for download.php ? The behavior is very peculiar.

 

Have you tried removing the white space between the doctype declaration and the closing php tag?(Kinda a long shot.)

//...?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Also, have you tried copying download.php to a new file to try and get rid of any unwanted invisible characters.

 

Also, the space is only visible in IE, top margin is offset by about 10px in Chrome (for me anyways...)

 

so source is identical in chrome(unless you view through inspect element window)....

 

I'm out of ideas on this one...

 

Thanks, I'll try these. :)

Link to comment
Share on other sites

Validator Results (download.php)

Validator Results (downloadprofile.php)

 

Look at the validator results.  In addition to other errors, you'll notice the results for download.php has on extra error complaining about a character before the doctype.  You will also notice on both the warning about the Byte-Order Mark.

 

This byte order mark is your problem most likely.  Re-save the files as UTF-8 but without the BOM.  What is probably happening is both your files have a BOM at the start of the file.  When you access downloadprofile.php by itself, then there is no problem because the BOM is removed since the document is handled as utf-8.  When you access it through download.php file, you end up with two BOM's (one from download.php, and one from downloadprofile.php).  The first one is handled as part of the utf-8 decode process, the second one is invalid and causing problems.

 

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.