Results 1 to 8 of 8

Thread: PHP Rendering Issues

  1. #1
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Post PHP Rendering Issues

    Hey guys...

    I have the following PHP code within a larger page (also included below):

    Troublesome PHP
    Code:
    	
    <? 
    if($fail)
    {
    echo "<div id=error>NO SEARCH RESULTS</div>";
    }
    else{
    if($_GET[s])
    echo "<div id=error>SEARCH RESULTS</div>";
    if(!sizeof($res))
    echo "<div id=error>NO POSTS TO DISPLAY</div>";
    foreach($res as $row){
    ?>

    Entire Document
    Code:
    <? 
    $fail = false;
    if(isset($_GET[s]))
    include("search.php"); 
    else
    include("recent.php"); 
    ?>
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="js/swfobject.js"></script>
    <link type="text/css" rel="stylesheet" href="css/Style.css" />
    <link rel="shortcut icon" href="favicon.ico" />
    <title>THEPAPERBAGWRITER // CHANGING THE WAY INFORMATION FLOWS</title>
    </head>
    <body bgcolor="#ffffff">
    
    <div id="container">
    
    	<div id="mainframe" >
    		<form id="myform" action="POST">
    			<input type="text" class="textinput" /> <input class="submit" type="image" src="images/form.png" />
    		</form>
    		
    		<div id="musicholder">
    			<div id="flashmusic">To view the header, please upgrade your Flash plugin.</div>
    				<script type="text/javascript">
    				var so = new SWFObject("musicPlayer.swf", "music", "340", "20", "8", "#CCCCCC");
    				so.addParam("quality", "high");
    				so.addParam("wmode", "opaque");
    				so.addParam("salign", "t");
    				so.addParam("scale", "noscale");
    				so.write("flashmusic");
    				</script>
    			
    		</div>
    		<div id="musiccredit" style='float:right;'><a href="http://www.caribou.fm/site/">MUSIC BY CARIBOU</a></div>
    		<div id="menuline">&nbsp;</div>
    		
    		<div id="flashcontent">To view the header, please upgrade your Flash plugin.</div>
    			<script type="text/javascript">
    			var so = new SWFObject("header2.swf", "index", "700", "250", "8", "#ffffff");
    			so.addParam("quality", "high");
    			so.addParam("wmode", "opaque");
    			so.addParam("salign", "t");
    			so.addParam("scale", "noscale");
    			so.write("flashcontent");
    			</script>
    		
    		<div id="leftframe">
    			<div id ="news">
    				<div id="framehead"><img src="images/news.jpg" alt="news" /></div>
    					<div id="newsart">
    						<span id="date">06.15.07</span>
    						<br />SUBMISSIONS FOR ISSUE ONE WILL BE CLOSING SOON, THIS IS YOUR LAST CHANCE TO SUBMIT YOUR POETRY, PROSE AND TEXT FOR CONSIDERATION IN OUR FIRST ISSUE.
    						<br />
    						<br /><span id="date">06.05.07</span>
    						<br />NEW PODCASTS!  WE ARE PLEASED TO ANNOUNCE OUR FIRST EVER PODCAST, PAPER + PLASTIC IS NOW AVAILABLE THROUGH OUR SITE,  APPLE.COM AND ON EAST VILLAGE RADIO.
    						<br />
    						<br /><span id="date">05.25.07</span>
    						<br />NEW SITE! ENJOY THE NEW SITE COURTESY OF DESIGNS BY VISHAL.  IF YOU HAVE ANY QUESTIONS OR COMMENTS, PLEASE EMAIL WEB@THEPAPERBAGWRITER.COM
    					</div>
    			</div>
    			<br />
    			<div id="video">
    				<div id="framehead" style='background-image:URL("images/videos.jpg");'><a href="http://www.adbusters.org"><img src="images/kalle.gif" style='float:right;margin-top:2px;' alt="Kalle Head" /></a></div>
    				<div id="youtube"><embed src="http://www.youtube.com/v/-GhXKILWcG8" type="application/x-shockwave-flash" width="100%" height="210"></embed></div>
    			</div>
    			<br />
    			<div id="personals">
    				<div id="framehead"><img src="images/personals.jpg" alt="personals" /></div>
    				<span id="opening">LOOKING FOR A CARTOONIST</span>
    				<span id="desc">Looking for a cartoonist, somewhere between 4’8 and 8’9, preferably male or female (although I don’t discriminate) must be out going, fun loving romantic who shares my adoration and enthusiasm for Fellini and Mozart and candle lit dinners.  Must have at least six fingers and some experience in the visual arts. <br /><br />*If you meet at least 32% of these requirements and are interested in joining our team, drop us a line at 516.474.3947 or email us at team@thepaperbagwriter.org</span>
    			</div>
    			
    			
    		</div>
    	
    		<div id="rightframe">
    			<div id ="rp">
    				<div id="framehead" style='width:98%'><img src="images/recentposts.jpg" alt="Recent Posts" /></div>
    				<? 
    				if($fail)
    				{
    				echo "<div id=error>NO SEARCH RESULTS</div>";
    				}
    				else{
    				if($_GET[s])
    				echo "<div id=error>SEARCH RESULTS</div>";
    				if(!sizeof($res))
    				echo "<div id=error>NO POSTS TO DISPLAY</div>";
    
    				foreach($res as $row){
    				?>
    				
    				<div id="postborder">
    					<div id="post">
    						<div id="title">
    						<? echo "<a href=$blogurl/".$row[blogid]."/?p=".$row[pid].">".$row[post_title]."</a>"; ?>
    						</div>
    			
    						<div id="content">
    							<? if($_GET[s]) echo parsecontent($row[post_content]); else echo $row[post_content]; ?><span id="more"><a href="<? echo "$blogurl/".$row[blogid]."/?p=".$row[pid]; ?>"> [...] MORE</a></span>
    						</div>
    					</div>
    				</div>
    				<?
    				}
    				}
    				?>
    			</div>	
    		</div>
    	</div>
    
    	<div id="sideframe">
    		<a href="brownpaper.php"><img src="images/firstissue.jpg" alt="First Issue" /></a>
    		<div id="framehead"><img src="images/bptitle.jpg" alt="Brown Paper" /></div>
    		<br />
    	
    		<a href="paperandplastic.php"><img src="images/pp.jpg" alt="Paper and Plastic" /></a>
    		<br />
    		
    		<a href="donations.php"><img src="images/donate2.jpg" alt="Donate" /></a>
    		<br />
    		
    		<a href="subscribe.php"><img src="images/subscribe2.jpg" alt="Subscribe" /></a>
    		<br />
    	
    		<a href="shop.php"><img src="images/shop2.jpg" alt="Shop" /></a>
    		<br />
    	
    		<a href="http://www.myspace.com/mybrownpaperbag"><img src="images/myspace2.jpg" alt="MySpace" /></a>
    
    	</div>
    </div>
    
    </body>
    </html>

    The "troublesome php" listed above seems to be setting of my page's alignment in FF. Screenshots of how it renders in FF and IE are here: http://www.dynamicdrive.com/forums/s...ad.php?t=22110.

    Does anyone know what could be causing this?

    When I take out that bit of php, it aligns perfectly (but then, it produces errors within the php so taking it out is not an option).

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What's the CSS for the "error" div? I'm almost positive that's the issue, and completely unrelated to the PHP code.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    This is no css for the error div.

    Should I add something?

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hm... I assumed that there was a width value applied to the divs that was throwing something off. If not, then I'm not sure.
    Can you link us to the page?

    Remember, the PHP itself has very little to do with what is actually displayed... just the source code of the page itself. Once you find the problematic part of the outputted source, all you need is to find the bit of php that outputs it.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    The page is here

    The weird part is that the error happens even when I test locally (i.e. the php is not running). So, I assumed it had to do with how the php is written.

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Any ideas, anyone?

  7. #7
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Simple answer: It's not a PHP issue, but it is a CSS issue.

    When I view the images in the thread you linked to and look at the page in both IE7 and FF, they both look the same (no problems whatsoever); however, I did notice there are a few CSS errors (when viewed in FF). Other than that, I have no clue what the problem is because it seems to be fixed in those browsers.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  8. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Thanks for the response!

    My issue is that there is no css over the "error" div. So, I'm failing to understand why this is causing an error.

Bookmarks

Posting Permissions

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