Jump to content

Php includes causing bad design issues


CLTaylor

Recommended Posts

I'm developing a new site in Expressions Web and saving the files as .php.

 

When I use the .php includes, it throws off my site design and I can't see how to fix it. Can someone please take a look at this page and let me know?

 

www.menopauseinfo.org

 

Thanks

 

Cathy

Link to post
Share on other sites

Please don't double post, someone could have moved it for you if you requested it.

 

Like I said in your other post, we can only see the final HTML with that link.  You're including your file in the wrong spot.  We would need to see the relevant code.

Link to post
Share on other sites

Ok, sorry. I was trying to find that right place to post because you said the first one was wrong. I pasted the code into the other location. Also, it appears that this problems happens only in IE and Mozilla is fine.

Link to post
Share on other sites

Ok, sorry. I was trying to find that right place to post because you said the first one was wrong. I pasted the code into the other location. Also, it appears that this problems happens only in IE and Mozilla is fine.

 

what do you mean it throws off your site design ? did you make the .php includes or are you just including them what do they have in them >:?

Link to post
Share on other sites

This is not a php/include problem. It is a HTML markup problem. Your page has a number of HTML errors that cause it to render differently in different browsers - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.menopauseinfo.org%2F&charset=(detect+automatically)&doctype=Inline&group=0

 

Edit: The biggest problems with it are there is no doctype and you have apparently placed, I'll guess using an include() statement, most of a web page inside of the <head> </head> section of your main page.

Link to post
Share on other sites

Thanks for your response regarding my html. I will have to find someone to fix these mistakes as I don't pretend to be a programmer of any kind.

 

Can someone please tell me what the doctype for php should be?

Link to post
Share on other sites

There is actually no doctype for php, because php is a server side scripting language that simply outputs HTML/CSS/Javascript to a browser to make up a valid web page.

 

This link talks about the HTML doctypes - http://w3schools.com/html/html_whyusehtml4.asp You should produce pages using the "strict" doctype whenever possible.

Link to post
Share on other sites

why dont you try to create a page in html that would lay out the page you want then just include the php files in the correct spot or you can just intermingle the html inside the php to get the lay out and the script..

 

check this out the file will be named index.php in my case.

 

<?php
session_start();  

//includes.
include 'dirconf.php';
include 'find/get_num_users.php';

echo '<link rel="stylesheet" type="text/css" href="../home/styles/generic1.css" >';

//set page title. 
echo '<title>' . $title . '</title>';

echo '<html>
<head></head>
<body text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff">
<table border="0" cellpadding="0" width="100%">
	<tr height="25px">
		<td colspan="2">';
			include '../home/test_title.php';
			echo '<center><font size="+1">Are you <i>"n"</i>?</font></center><br><br>';
		echo '</td>		
	</tr>
	<tr>
		<td width="40%" valign="top">';	
		echo '<form method="post" action="auth.php">
				<br>';
				if($cutoff>0) {					
					echo '       <input type="button" name="signup" value="sign up" style="width:90px;" onClick="window.location=\'../signup/signup.php\'">';
				}		
				echo '<br><br>
				enter username: <input type="text" name="username"><br >
				<br >
				enter password: <input type="password" name="password"><br >
				<br >
				       <input type="submit" name="submit" style="width:90px;" value="log in">';	
	echo '</form><br><br>
	<center>';
		echo $numusers;
	echo	'</center>
		</td>
		<td width="70%" valign="top" align="center">
				<br><br><br><br>';
				include 'find/find_user.php';		
	echo	'</td>
	</tr>
	</table>

</body>
</html>';

?>

 

hope this helps..

 

mike

Link to post
Share on other sites

Thanks for the help, but my problem is I'm not a coder.

 

Maybe it will help to show you the 2 pages I have created.

This page www.menopauseinfo.org/index.php works fine

 

But the minute I add the .php includes, I get this:

www.menopauseinfo.org/index-old.php

 

Maybe someone can tell what's causing the problem now.

 

Thanks

Link to post
Share on other sites

Thanks for trying Mike. I'm posting the code here for you to see. My html helpers tell me I have an incomplete DOCTYPE, so I'm also including that.

 

If you look at www.menopauseinfo.org/index.htm you can see that the page loads fine. UNTIL I had the .php includes which you can see at www.menopauseinfo.org/index.php

 

  <table width="900" border="0" cellspacing="0" cellpadding="0"
  align="center">
    <tr valign="top">
      <td width="165" bgcolor="#EEEEEE">
        <table width="165" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/left_red.jpg" width="165" height="27" /></td>
          </tr>
          <tr>
            <td> <?php include("include/links.php"); ?><br></td>
          </tr>
          <tr>
            <td><img src="images/left_orange.jpg" width="165" height="29" /></td>
          </tr>
          <tr>
            <td> <?php include("include/newsletter.php"); ?></td>
          </tr>
        </table>

 

Here's what I have for my head in case that helps.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd.">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <meta name="TITLE" content=  "Menopause | Menopause Symptoms | Early Menopause">

  <meta name="description" content=  "Menopause articles, resources and links so you can learn how to eliminate the symptoms of menopause">

  <meta name="keywords" content=  "menopause symptoms,hormones,estrogen,progesterone,hot flashes,night sweats,perimenopause,bioidenticals">

  <meta http-equiv="Content-Type" content=  "text/html; charset=us-ascii">

  <link rel="stylesheet" href="styles.css" type="text/css">

</head>

 

 

 

Link to post
Share on other sites

well unless you are just not showing it, the code below that you supplied starts two tables and only closed one...

<table width="900" border="0" cellspacing="0" cellpadding="0"
  align="center">
    <tr valign="top">
      <td width="165" bgcolor="#EEEEEE">
        <table width="165" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/left_red.jpg" width="165" height="27" /></td>
          </tr>
          <tr>
            <td> <?php include("include/links.php"); ?><br></td>
          </tr>
          <tr>
            <td><img src="images/left_orange.jpg" width="165" height="29" /></td>
          </tr>
          <tr>
            <td> <?php include("include/newsletter.php"); ?></td>
          </tr>
        </table>

 

try this one if that is the case...

 

<table width="900" border="0" cellspacing="0" cellpadding="0"
  align="center">
    <tr>
      <td valign="top" width="165" bgcolor="#EEEEEE">
        <table width="165" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/left_red.jpg" width="165" height="27" /></td>
          </tr>
          <tr>
            <td> <?php include("include/links.php"); ?><br></td>
          </tr>
          <tr>
            <td><img src="images/left_orange.jpg" width="165" height="29" /></td>
          </tr>
          <tr>
            <td> <?php include("include/newsletter.php"); ?></td>
          </tr>
        </table>
     </td>
  </tr>
</table>

Link to post
Share on other sites

dont think that will work ether after looking at the page again

 

try this

 

<table width="900" border="0" cellspacing="0" cellpadding="0"
  align="center">
    <tr>
      <td valign="top"  bgcolor="#EEEEEE">
        <table width="165" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/left_red.jpg" width="165" height="27" /><br>
                     <?php include("include/links.php"); ?><br>
           </td>
          </tr>
          <tr>
            <td><img src="images/left_orange.jpg" width="165" height="29" /><br>
                     <?php include("include/newsletter.php"); ?></td>
          </tr>
        </table>
     </td>
  </tr>
</table>

 

the only other think is if one of the included files has tables in them and there is a problem there........

Link to post
Share on other sites

I don't know what state I'm catching this in now but I'm looking at a large chunk of paragraphs of text sat at the bottom of the page when they look like they should be placed in the large section to the right of the menu.

 

So many tables there but if this isn't how it should look - well, I'd use DIVs.

Link to post
Share on other sites

I advise against saving PHP files as UTF-8 (with or without BOM) as I had strange padding problems appear where I'd get vertical padding appear at the point of files being included.

 

I changed them to plain ANSI and the padding disappeared.

 

Pulled my hair out over this myself for a good couple weeks until I accidentally discovered it was UTF-8 causing the problem.

Link to post
Share on other sites

Just want to thank everyone who has tried to help. I have saved the files both in utf-8 and ansi and it has not made any difference yet.

 

I tried adding the extra table at the end Mike, and what was strange about that is it made the skewed design show up in my htm editor the way it was on the server. Before, it was just on the server. So wierd.

 

I tried putting the java around the includes like this:

            <td> echo <script> echo/* ("include/links.php"); echo */ echo <script> <br></td>
          </tr>
          <tr>
            <td><img src="images/left_orange.jpg" width="165" height="29" /></td>
          </tr>
          <tr>
            <td> echo <script> echo/* ("include/newsletter.php"); echo */ echo <script></td>

 

and got this page as a result: www.menopauseinfo.org/index2.php

Link to post
Share on other sites

I'm developing a new site in Expressions Web and saving the files as .php.

 

When I use the .php includes, it throws off my site design and I can't see how to fix it. Can someone please take a look at this page and let me know?

 

www.menopauseinfo.org

 

Thanks

 

Cathy

 

i cant belive you still havent fixed it

Link to post
Share on other sites

do the included files contain tables....

 

if so are they all correct.....

 

using a lot of tables within tables can produce strange effects if one of the tables is not proper..........

 

just a thought at this point for you to look at......

 

mike.....

Link to post
Share on other sites

GREAT NEWS - my siteis alive! Thanks to all that cared enough to help. But the prize goes to Mike - it was the tables! I cleaned up the html on the tables and voila ... it's perfect.

 

Thanks everyone. Have a great weekend!

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.