LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-15-2009, 09:01 PM   #1
jus71n742
Member
 
Registered: Apr 2008
Distribution: Ubuntu 8.04 64bit/ 32bit, FreeBSD 8
Posts: 185

Rep: Reputation: 30
PHP formatting error


I have written a couple pages in PHP and I am having a difficult time getting everything displayed correctly. I have it all displaying but I believe there is a border issue. I have a sidebar on all the pages. When the home page comes up its on the top right, which is where I designated for it to be in the .css . The .php pages however show the information bar down at the bottom as well as making the footer much smaller than normal.
correct page : roanekarate.com
incorrect page: above with /press/press.php

all that is wrong in the sidebar to the right and footer at the bottom.
Code:
     /* Sidebar */
    #sidebar {
    	float: right;
    	width: 280px;
    }
    #sidebar ul {
    	margin: 0;
    	padding: 0;
    	list-style: none;
    }
    #sidebar li {
    	margin-bottom: 20px;
    	background: #1A1A1A;
    	border: 5px solid #050505;
    }
    #sidebar li ul {
    	padding: 20px;
    }
    #sidebar li li {
    	margin: 0;
    	background: none;
    	border: none;
    }
    #sidebar li li a {
    	padding-left: 15px;
    	background: url() no-repeat left center;
    	text-decoration: none;
    }
    #sidebar li li a:hover {
    	text-decoration: underline;
    }
    #sidebar h2 {
    	height: 40px;
    	margin: 0;
    	padding: 10px 0 0 10px;
    	background: #1A1A1A url() repeat-x;
    	letter-spacing: -1px;
    	font-size: 1.8em;
    	color:#FFFFFF;
    	
    }
    /* Footer */
    #footer {
    	clear: both;
    	height: 100px;
    	padding: 20px;
    	background: #1A1A1A;
    	border-top: 10px solid #050505;
    }
    #footer p {
    	margin: 0;
    	text-align: center;
    	color: #444444;
    }
    #footer a {
    	color: #444444;
    }
If anyone thinks it could be in the PHP then let me know and I will put it up.
 
Old 05-16-2009, 10:45 AM   #2
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Do a "View Source" from your browser on each of the two pages to find discrepancies.

My first guess is that the test page may have one or more <div> tags without corresponding </div> end tags. The W3C validator at http://validator.w3.org is very helpful in this regard.

Also, since the test page is in a side folder, make sure your references to stylesheets, images, etc. are correctly descending the directory tree with "../" parent folder references.
 
Old 05-20-2009, 02:07 PM   #3
jus71n742
Member
 
Registered: Apr 2008
Distribution: Ubuntu 8.04 64bit/ 32bit, FreeBSD 8
Posts: 185

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dogpatch View Post
Do a "View Source" from your browser on each of the two pages to find discrepancies.

My first guess is that the test page may have one or more <div> tags without corresponding </div> end tags. The W3C validator at http://validator.w3.org is very helpful in this regard.

Also, since the test page is in a side folder, make sure your references to stylesheets, images, etc. are correctly descending the directory tree with "../" parent folder references.
Its the same code exactly, I copied the file into each directory unmodified. just so I wouldn't have to do a long address. I even went back and put each CSS to the other pages (PHP and HTML) and switched the paths all around...still same error.
 
Old 05-20-2009, 02:22 PM   #4
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
I would start by fixing any error reported by the W3C Mark-up validator. The offending page has 84 errors. One of these may be the cause of your problem.
 
Old 05-21-2009, 10:29 AM   #5
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Quote:
Originally Posted by jus71n742 View Post
Its the same code exactly, I copied the file into each directory unmodified. just so I wouldn't have to do a long address. I even went back and put each CSS to the other pages (PHP and HTML) and switched the paths all around...still same error.
When i do a "View Source" from my browser on the two pages, they are very different. Too many discrepancies to list here. Just try the "View Source" route and see for yourself. Obviously, your php script is not generating the markup code that you think it is.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: formatting current date & time as: 2006-04-12 13:47:36 and substract 15 minutes NaCo Linux - Software 4 11-13-2008 07:31 PM
formatting error Lost In Here Linux - Laptop and Netbook 1 03-02-2008 07:26 AM
/etc/mailcap formatting error TheOneKEA Debian 6 02-22-2007 07:55 AM
PHP+SQL : formatting text for presentation in a blob caged Programming 2 11-24-2004 05:48 PM
Error: Formatting of failed? snowboard_guy Linux - Newbie 3 05-21-2004 08:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration