Jump to content

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 comment
https://forums.phpfreaks.com/topic/154114-php-includes-causing-bad-design-issues/
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.

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 >:?

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.

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.

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

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

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>

 

 

 

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>

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

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.

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.

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

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

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

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.