HOME       >>       Websites and Web Designing

Need Layout Assistance: Content Area Is Not In Middle [resolved] I desperately need help with my css site


Hi guys & girls,

i have a big problem, because I am making a site for this congress and here is what is happening to my site using CSS. When I check it on my wamp local server, everything looks great, but when I put it on the internet here on trap, things just don't work anymore...

Please click to visit my problematic site

How can I make this "WELCOME... " div in the middle and the sidebar with news to the right..

Pleeeeease help soon..

Thanks in advance


Move this:

<div id="content"><h2>Welcome to prime congress 2007! </h2><p> </p></div>

outside all DIV tags, to the bottom...


Thank you for that, but there is still a problem. The right "sidebar div" is now a bit too low and the bottom "footer div" is not cleared even though I did clear: both on the footer div in the css...Pleeeease help..


Thank you for everything TRUEFUSION, after an hour and with your help I DID NOT managed to fix it...NEW PROBLEM is in the post below..thx for helping out..


What Browser are you using? I am looking at it in IE6 and Fx2 and both look the same.Can you be more descriptive of the problem? and did you know about the php errors on the news sidebar?


Thanks for being here...Yes, now my problem is the <? include("news.txt") ?> which ruins the whole thing as I've found out! The thing is that when the document is parsed, it is all ok untill it reaches the <?include> section. Anyone maybe know what is wrong and how can i fix this?I am lookin' in OPERA 9 and in IE 6, using macromedia dreamweaver...I am using this simple PHP news script which works with only a simple news.txt file....is there any way to make it work like it is now??? Anyone maybe know of some other scripts for news like this one that can be css-manipulated and built in this site..THANKS for everything guys and PLEASE HELP..Mark


Move the sidebar div above the footer div, and it'll be good.And the news script looks like it'll work just fine, once the output is raised. (see above)


I did that as you can see HERE but the "footer div" is not below where it should be. If I remove the <? inlcude...> code it is down below where it should be...the footer should ba 100% at the bottom..


thanks for cooperating..

EDIT: Please REFRESH if everything is the same..


<div id="sidebar"> <table class='sn'> <tbody> <tr><td class='sn-title'> Site is up & running </td></tr> <tr><td class='sn-date'> Posted on: 13/02/2007 </td></tr> <tr><td class='sn-post'> Here it is - the official site of the Spring Congress 2007. Please get into the net! </td></tr> </tbody></table><div><br /> <p align="center"><a href="admini/post.php" target="_blank">Admin Area</a></p></div>
That is the code as per a view source.

Add an ending div tag to see what happens. I think you have missed one there at the end.


Here is the code that is used...I think the problem is that parsing stops at <? include...>, because of some sort of incompatibility or what?. Is that possible?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/ http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>Prime Congress 2007</title><link href="css/style.css" type="text/css" /><link href="css/news_style.css" type="text/css" /></head><body><div id="container"><img id="prime"src="images/prime.gif" /><img id="ptic" src="images/ptic.gif" /><div id="header"></div><div id="navigation"> <ul id="navlist"> <li><a href="index.php">Home</a></li> <li><a href="programe.php">Programe</a></li> <li><a href="lectures.php">Lectures & Lecturers </a></li> <li><a href="challenges.php">Challenges</a></li> <li><a href="organization.php">Organizing Team </a></li> <li><a href="participants.php">Participants</a></li> <li><a href="transportation.php">Transportation Info </a></li> <li><a href="slovenia.php">About Slovenia</a></li> <li><a href="application.php">Application</a></li> <li><a href="partners.php">Partners & Sponsors</a></li> <li><a href="press.php">Press Releases</a> <p align="left"><strong>Please sign the application and be a part of PRIME 2007!</strong><br /> <a href="application.php">Click here to SIGN IN! </a></p></li> </ul> </div> <div id="content"> <h2>Welcome to prime congress 2007! </h2> </div> <div id="sidebar"> <? include("news.txt"); ?><p align="center"><a href="admini/post.php" target="_blank">Admin Area</a></p></div> <div id="footer"> <p align="center"><a href="http://validator.w3.org/check?uri=referer" target="_blank">Valid XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">Valid CSS</a> | Copyright Š Mark Debeljak</p> </div> </div></body></html>

Everything looks allright escept the <?include> i guess??? Any other suggestions?



post the php code from the includes


OK, this is the post.php - script which allows you to add news in a news.txt file:

<?//File to keep news in. If you are using the secure setup described in the//readme with post.php in an .htaccessed admin dir you must update the location//of news.txt file in the next variable.$newsfile = "news.txt";//Open news.txt in read mode. $file = fopen($newsfile, "r");//Table Vars The below variables are inserted verbatim into the news.txt file.//This gives you a lot of control over how the news will look. The//disadvantage is that if you ever decide you don't like how these look you//can't change one thing like with CSS to adapt it to your liking. You will//have to do a mass "find and replace" on the news.txt file. In other words://these are essentially the HTML tags that will go around your entries. //b=begin e=end$btable = "<table class='sn'> <tbody>";$btitle = "<tr><td class='sn-title'>";$etitle = "</td></tr>";$bdate = "<tr><td class='sn-date'> Posted on:";$edate = "</td></tr>";$bpost = "<tr><td class='sn-post'>";$epost = "</td></tr>";$etable = "</tbody></table><div><br /></div>";//Define PHP Date format. Used for the default date form value. $defdate=date("d/m/Y");//Other notes//The date is automatically set to todays date by using PHP to echo the//variable of defdate. The form action uses this file itself to process the//data. // The If/Else statements decide what is displayed based on whether a HTTP GET// or POST was issued by the browser. GET: If the submit button has not been// pushed -- display form. PUT: Submit button has been pushed -- write data to// text file and display confirmation message. //IF browser does not send a POST request (ie: if submit has not been pressed)//then display the form....if ($_SERVER['REQUEST_METHOD'] != 'POST'){//If able to open file do...if ($file) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/ type="text/css">h2 {text-align: center}</style><title>Simple News: Post</title></head><body><h2>Simple News: Post An Entry</h2><form action="<? echo $_SERVER['../admin/PHP_SELF']; ?>" method="post"><div style="text-align: center">Title: <input type="text" name="title" /> <br />Date: <input type="text" name="date" value="<? echo $defdate; ?>" /> <br />Entry:<br /> <textarea rows="30" cols="80" style="border: 1px solid #666666;" name="post"></textarea><br /><input type="submit" value="Add News" /></div></form></body></html><?}else //If can not open file complain...echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://forums.xisto.com/no_longer_exists/ News: Error </title></head><body><p>Could not open file. <br /> Permissions??</p></body></html>";}//ELSE IF browser sends a POST request. Make sure that data was actually//entered into the form and then write that data to the file....elseif ((isset($_REQUEST["title"])) && (isset($_REQUEST["date"])) &&(isset($_REQUEST["post"])) && ($_REQUEST["title"]!="") &&($_REQUEST["date"]!="") && ($_REQUEST["post"]!="")) {//The next few lines are a hacked up way to "add" text to the top of a file.//// The file is already opened in read mode. Read in all the current data//from news.txt. Save this as variable current_data.$current_data = @fread($file, filesize($newsfile));//Now that we have saved the old data to a variable lets close the file. fclose($file);//Now we reopen the file in write mode. This FIRST blanks the file. Then will//will write the new data followed by the old data to the file. $file = fopen($newsfile, "w");//Write all of the table variables and the text entered into the form, plus the//text that was already in news.txt to news.txt. The \n is a new line and it//simply make news.txt more beautiful. If it works display success message, if//not display failure message. //// Fix quotes (') in entries and change any weird//characters (&,<,>,etc) to their html equivalents. Do the same for title and//date. Even though it should not be needed for date. $_REQUEST["post"] = stripslashes(($_REQUEST["post"]));$_REQUEST["date"] = stripslashes(($_REQUEST["date"]));$_REQUEST["title"] = stripslashes(($_REQUEST["title"]));if(fwrite($file,$btable . " " . $btitle . " " . $_REQUEST["title"] . " " . $etitle . " " . $bdate . " " . $_REQUEST["date"] . " " . $edate . " " . $bpost . " " . $_REQUEST["post"] . " " . $epost . " " . $etable . "\n " . $current_data))echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://forums.xisto.com/no_longer_exists/ News: Entry Added</title></head><body><p>Entry added successfully.<br /> <a href=\"\">Add</a> another.</p></body></html>";else echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://forums.xisto.com/no_longer_exists/ News: Entry NOT Added!</title></head><body><p>Could not add entry.<br /> Permissions??</p></body></html>";//Close the file. fclose($file);}//If the browser sent a POST request but the user failed to put data in the//form...spit out this error. elseecho "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://forums.xisto.com/no_longer_exists/ News: Entry NOT Added!</title></head><body><p>Could not add entry. <br /> All the fields in the form are *required*. <br /> Please go back and try again.</p></body></html>";?>

Then here is this news.txt that is then included:

<table class='sn'> <tbody> <tr><td class='sn-title'> Site is up & running </td></tr> <tr><td class='sn-date'> Posted on: 13/02/2007 </td></tr> <tr><td class='sn-post'> Here it is - the official site of the Spring Congress 2007. Please get into the net! </td></tr> </tbody></table><div><br />

And that is practicly the whole script...

All you have to do is <? include("news.txt"); ?> somewhere in your page where you want it and it should work....but not here

Does it have to do with css parsing and php include messing it all up????

Thanks man for evrthng..


</table><div><br />
remove the opening div tag from inside the included file.
I thought you had missed an end tag, but perhaps you hav an extra start tag.
the div tags seem to match in the html, so I suspected something in the include.

Hope it works.

Also, add some alt='s to your images and you should be valid.


Alternately, add a div tag to the front and a slash on the existing one...


Oh I can't believe my eyes...IT WOOOORKS:)))))Thanks maaan, you ARE THE BEST!! Saved my life and sleep tonight...heheI'll add those alt's yeah, so I'll be totally legit :PThanks again for helping me out and Good night!Best whishes


Boy, some people are easy to please...


You are very welcome.


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.