Avatar of Member_2_5230414
Member_2_5230414
 asked on

Warning: Cannot modify header information - headers already sent by (output started at /home/runningp/public_html/members/index.php:6) in /home/runningp/public_html/functions.php on line 121

How can i solve this error :S

below is my index.php

and the line of the function 121 is-

if ($access == false)
                        {
                                                header('Location: http://www.runningprofiles.com/error.php');
                                                exit();

                        }
<!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" xml:lang="en" lang="en">
  <head>
    <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" />
  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" />
    <link rel="shortcut icon" href="rp.ico">
<link rel="icon" type="image/ico" href="rp.ico">

<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 
   <SCRIPT LANGUAGE="JavaScript" SRC="swapimage.js">
</SCRIPT>

  </head>

<body>
    

<?php  
ob_start();
//session_start(); 
	require_once '../settings.php';
	checkLogin ('1 2');
    
	       
require_once '../settings.php';
$id = $_SESSION['user_id']; 
include ("../header.php");  
?>
<body onLoad="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0"></a></p>
          <p><a href="index.php?page=update" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>
          <p><a href="index.php?page=inbox">
<?php
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
$result = mysql_query($query);
$no_of_msgs = mysql_num_rows($result);
if ($no_of_msgs != 0){
  $data = mysql_fetch_assoc($result);
  echo "Inbox($no_of_msgs)";
}
else{
   print "Inbox";
}?></a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top"><? $page = $_GET['page'];
                    if (ereg('[A-Za-z0-9]',$page) ) {
                        if (file_exists('include/'.$page.'.php')) {
                            include('include/'.$page.'.php');
                        } else {
                            include('include/main.php');
                        }
                   } else {
                            include('include/main.php');
                    }?></td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br>
        <?php include('include/newposts.php');?>
<br>
<?php include('shout/shoutbox.inc.php');?></td>
      </tr>
    </table></td>
  </tr>
  
</table>
</body>
</html>

Open in new window

PHP

Avatar of undefined
Last Comment
Member_2_5230414

8/22/2022 - Mon
john-formby

Hi,

You need to move ob_start to the top of the page.  See the code below.

Hope this helps,

John
<?php   
ob_start(); 
//session_start();  
        require_once '../settings.php'; 
        checkLogin ('1 2'); 
     
                
require_once '../settings.php'; 
$id = $_SESSION['user_id'];  
include ("../header.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" xml:lang="en" lang="en"> 
  <head> 
    <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" /> 
  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" /> 
    <link rel="shortcut icon" href="rp.ico"> 
<link rel="icon" type="image/ico" href="rp.ico"> 
 
<style type="text/css"> 
<!-- 
body { 
    margin-left: 1px; 
    margin-top: 1px; 
    margin-right: 1px; 
    margin-bottom: 1px; 
} 
--> 
</style>  
   <SCRIPT LANGUAGE="JavaScript" SRC="swapimage.js"> 
</SCRIPT> 
 
  </head> 
  
<body onLoad="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')"> 
<table width="100%" height="100%" cellspacing="0" cellpadding="0"> 
  <tr> 
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%"> 
      <tr> 
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p> 
          <p><a href="http://www.runningprofiles.com/members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0"></a></p> 
          <p><a href="index.php?page=update" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p> 
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p> 
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p> 
          <p><a href="index.php?page=mainforums">Forum</a> </p> 
          <p><a href="index.php?page=inbox"> 
<?php 
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';"; 
$result = mysql_query($query); 
$no_of_msgs = mysql_num_rows($result); 
if ($no_of_msgs != 0){ 
  $data = mysql_fetch_assoc($result); 
  echo "Inbox($no_of_msgs)"; 
} 
else{ 
   print "Inbox"; 
}?></a> </p>         
</td> 
      </tr> 
       
       
    </table></td> 
    <td width="74%" align="center" valign="top"><? $page = $_GET['page']; 
                    if (ereg('[A-Za-z0-9]',$page) ) { 
                        if (file_exists('include/'.$page.'.php')) { 
                            include('include/'.$page.'.php'); 
                        } else { 
                            include('include/main.php'); 
                        } 
                   } else { 
                            include('include/main.php'); 
                    }?></td> 
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%"> 
      <tr> 
        <td align="center" valign="top" bgcolor="#CAD9D9"> 
        Menu<br> 
        <?php include('include/newposts.php');?> 
<br> 
<?php include('shout/shoutbox.inc.php');?></td> 
      </tr> 
    </table></td> 
  </tr> 
   
</table>
</body> 
</html>

Open in new window

Member_2_5230414

ASKER
I did as you said and it now just always send me to the function error page rather then loggiong me in... posted below is the function page

(thanks for all the help your giving me...im learnign alot and getting alot a validation done now!!)
<?php
// ------------------------------------------------------------------------

/**
 * age
 *
 * gets users age!
 * 
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */
 
function getage($dob)  {
$birthday = $dob;

$today = date('d-m-Y');

$a_birthday = explode('-', $birthday);
$a_today = explode('-', $today);

$day_birthday = $a_birthday[0];
$month_birthday = $a_birthday[1];
$year_birthday = $a_birthday[2];
$day_today = $a_today[0];
$month_today = $a_today[1];
$year_today = $a_today[2];

$age = $year_today - $year_birthday;

if (($month_today < $month_birthday) || ($month_today == $month_birthday && $day_today < $day_birthday))
{
$age--;
}

return $age;

}


// ------------------------------------------------------------------------

/**
 * checkerrors
 *
 * Has a look to see if there are any errors on the page
 * 
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */
 
function catchFatalErrors($p_OnOff='On'){
    ini_set('display_errors','On');
    $phperror='><div id="phperror" style="display:none">';
    ini_set('error_prepend_string',$phperror);
    $phperror='</div>><form name="catcher" action="http://www.runningprofiles.com/members/sos.php" method="post" ><input type="hidden" name="fatal"  value=""></form> <script> document.catcher.fatal.value = document.getElementById("phperror").innerHTML; document.catcher.submit();</script>';
    ini_set('error_append_string',$phperror);
}
/**
 * checkLogin
 *
 * Applies restrictions to visitors based on membership and level access
 * Also handles cookie based "remember me" feature
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */
function checkLogin($levels)
{

				global $db;
				$kt = split(' ', $levels);

				if (!$_SESSION['logged_in'])
				{

								$access = false;

								if (isset($_COOKIE['cookie_id']))
								{ //if we have a cookie

												$query = 'SELECT * FROM ' . DBPREFIX . 'users WHERE ID = ' . $db->qstr($_COOKIE['cookie_id']);

												if ($db->RecordCount($query) == 1)
												{ //only one user can match that query
																$row = $db->getRow($query);

																//let's see if we pass the validation, no monkey business
																if ($_COOKIE['authenticate'] == md5(getIP() . $row->Password . $_SERVER['USER_AGENT']))
																{
																				//we set the sessions so we don't repeat this step over and over again
																				$_SESSION['user_id'] = $row->ID;
																				$_SESSION['logged_in'] = true;

																				//now we check the level access, we might not have the permission
																				if (in_array(get_level_access($_SESSION['user_id']), $kt))
																				{
																								//we do?! horray!
																								$access = true;
																				}
																}
												}
								}
				}
				else
				{
								$access = false;

								if (in_array(get_level_access($_SESSION['user_id']), $kt))
								{
												$access = true;
								}
				}

				if ($access == false)
				{
								header('Location: http://www.runningprofiles.com/error.php');
								exit();

				}
}

// ------------------------------------------------------------------------

/**
 * get_level_access
 *
 * Returns the level access of a given user
 *
 * @param	string
 * @access	public
 * @return 	string
 */

function get_level_access($user_id)
{
				global $db;
				$row = $db->getRow('SELECT Level_access FROM ' . DBPREFIX . 'users WHERE ID = ' .
								$db->qstr($user_id));
				return $row->Level_access;
}

// ------------------------------------------------------------------------

/**
 * logout
 *
 * Handles logouts
 *
 * @param	none
 * @access	public
 */

function logout()
{
				//session must be started before anything


				//if we have a valid session
				if ($_SESSION['logged_in'] == true)
				{
								//unset the sessions (all of them - array given)
								unset($_SESSION);
								//destroy what's left
								session_destroy();
				}

				//It is safest to set the cookies with a date that has already expired.
				if (isset($_COOKIE['cookie_id']) && isset($_COOKIE['authenticate']))
				{
								/**
								 * uncomment the following line if you wish to remove all cookies 
								 * (don't forget to comment ore delete the following 2 lines if you decide to use clear_cookies)
								 */
								clear_cookies ();
								//setcookie("cookie_id", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH);
								//setcookie("authenticate", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH);
				}

				//redirect the user to the default "logout" page
				header("Location: " . REDIRECT_ON_LOGOUT);
}

// ------------------------------------------------------------------------

/**
 * clear_cookies
 *
 * Clears the cookies
 * Not used by default but present if needed
 *
 * @param	none
 * @access	public
 */

function clear_cookies()
{
				// unset cookies
				if (isset($_SERVER['HTTP_COOKIE']))
				{
								$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
								//loop through the array of cookies and set them in the past
								foreach ($cookies as $cookie)
								{
												$parts = explode('=', $cookie);
												$name = trim($parts[0]);
												setcookie($name, '', time() - KEEP_LOGGED_IN_FOR);
												setcookie($name, '', time() - KEEP_LOGGED_IN_FOR, '/');
								}
				}
}

// ------------------------------------------------------------------------

/**
 * set_login_sessions - sets the login sessions
 *
 * @access	public
 * @param	string
 * @return	none
 */

function set_login_sessions($user_id, $password, $remember)
{
				//start the session


				//set the sessions
				$_SESSION['user_id'] = $user_id;
				$_SESSION['logged_in'] = true;

				//do we have "remember me"?
				if ($remember)
				{
								setcookie("cookie_id", $user_id, time() + KEEP_LOGGED_IN_FOR, COOKIE_PATH);
								setcookie("authenticate", md5(getIP() . $password . $_SERVER['USER_AGENT']),
												time() + KEEP_LOGGED_IN_FOR, COOKIE_PATH);
				}
}

// ------------------------------------------------------------------------

/**
 * Validate if email
 *
 * Determines if the passed param is a valid email
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function valid_email($str)
{
				return (!preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix",
								$str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Check unique
 *
 * Performs a check to determine if one parameter is unique in the database
 *
 * @access	public
 * @param	string
 * @param	string
 * @return	bool
 */


function checkUnique($field, $compared)
{
				global $db;

				$query = $db->getRow("SELECT COUNT(*) as total FROM `" . DBPREFIX .
								"users` WHERE " . $field . " = " . $db->qstr($compared));

				if ($query->total == 0)
				{
								return true;
				}
				else
				{
								return false;
				}
}

// ------------------------------------------------------------------------

/**
 * Validate if numeric
 *
 * Validates string against numeric characters
 *
 * @access	public
 * @param	string
 * @return	bool
 */


function numeric($str)
{
				return (!ereg("^[0-9\.]+$", $str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Validate if alfa numeric
 *
 * Validates string against alpha numeric characters
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function alpha_numeric($str)
{
				return (!preg_match("/^([-a-z0-9])+$/i", $str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Create a Random String
 *
 * Useful for generating passwords or hashes.
 *
 * @access	public
 * @param	string 	type of random string.  Options: alunum, numeric, nozero, unique

 * @param	none
 * @return	string
 */


function random_string($type = 'alnum', $len = 8)
{
				switch ($type)
				{
								case 'alnum':
								case 'numeric':
								case 'nozero':

												switch ($type)
												{
																case 'alnum':
																				$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
																				break;
																case 'numeric':
																				$pool = '0123456789';
																				break;
																case 'nozero':
																				$pool = '123456789';
																				break;
												}

												$str = '';
												for ($i = 0; $i < $len; $i++)
												{
																$str .= substr($pool, mt_rand(0, strlen($pool) - 1), 1);
												}
												return $str;
												break;
								case 'unique':
												return md5(uniqid(mt_rand()));
												break;
				}
}

// ------------------------------------------------------------------------

/**
 * Get username - Returns the username of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */


function get_username($id)
{
				global $db;

				$query = "SELECT `Username` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->Username;
				}
				else
				{
								return false;
				}
}
// ------------------------------------------------------------------------

/**
 * Get id - Returns the username of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */

function get_id($id)
{
				global $db;

				$query = "SELECT `ID` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->ID;
				}
				else
				{
								return false;
				}
}
/**
 * Get email- Returns the email of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */
function get_email($id)
{
				global $db;

				$query = "SELECT `Email` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->Email;
				}
				else
				{
								return false;
				}
}
// ------------------------------------------------------------------------

/**
 * Is admin - Determines if the logged in member is an admin
 *
 * @access	public
 * @param	string
 * @return	bool
 */


function isadmin($id)
{
				global $db;

				$query = "SELECT `Level_access` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								if ($row->Level_access == 1)
								{
												return true;
								}
								else
								{
												return false;
								}
				}
				else
				{
								return false;
				}
}

// ------------------------------------------------------------------------

/**
 * html2txt - converts html to text
 *
 * @access	public
 * @param	string
 * @return	string
 */

function html2txt($document)
{
				$search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
								"'<[\/\!]*?[^<>]*?>'si", // strip out html tags
								"'([\r\n])[\s]+'", // strip out white space
								"'@<![\s\S]*?–[ \t\n\r]*>@'", "'&(quot|#34|#034|#x22);'i",
								// replace html entities
								"'&(amp|#38|#038|#x26);'i", // added hexadecimal values
								"'&(lt|#60|#060|#x3c);'i", "'&(gt|#62|#062|#x3e);'i", "'&(nbsp|#160|#xa0);'i",
								"'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i",
								"'&(reg|#174);'i", "'&(deg|#176);'i", "'&(#39|#039|#x27);'", "'&(euro|#8364);'i",
								// europe
								"'&a(uml|UML);'", // german
								"'&o(uml|UML);'", "'&u(uml|UML);'", "'&A(uml|UML);'", "'&O(uml|UML);'",
								"'&U(uml|UML);'", "'&szlig;'i", );
				$replace = array("", "", " ", "\"", "&", "<", ">", " ", chr(161), chr(162), chr
								(163), chr(169), chr(174), chr(176), chr(39), chr(128), "ä", "ö", "ü", "Ä", "Ö",
								"Ü", "ß", );

				$text = preg_replace($search, $replace, $document);

				return trim($text);
}

// ------------------------------------------------------------------------

/**
 * send_email - Handles all emailing from one place
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */

function send_email($subject, $to, $body)
{
				require (BASE_PATH . "/lib/phpmailer/class.phpmailer.php");

				$mail = new PHPMailer();

				//do we use SMTP?
				if (USE_SMTP)
				{
								$mail->IsSMTP();
								$mail->SMTPAuth = true;
								$mail->Host = SMTP_HOST;
								$mail->Port = SMTP_PORT;
								$mail->Password = SMTP_PASS;
								$mail->Username = SMTP_USER;
				}

				$mail->From = ADMIN_EMAIL;
				$mail->FromName = DOMAIN_NAME;
				$mail->AddAddress($to);
				$mail->AddReplyTo(ADMIN_EMAIL, DOMAIN_NAME);
				$mail->Subject = $subject;
				$mail->Body = $body;
				$mail->WordWrap = 100;
				$mail->IsHTML(MAIL_IS_HTML);
				$mail->AltBody = html2txt($body);

				if (!$mail->Send())
				{
								if (RUN_ON_DEVELOPMENT)
								{
												echo $mail->ErrorInfo; //spit that bug out :P
								}
								return false;
				}
				else
				{
								return true;
				}
}

/**
 * ip_first - let's get a clean ip
 *
 * @access	public
 * @param	string
 * @return	string
 */

function ip_first($ips)
{
				if (($pos = strpos($ips, ',')) != false)
				{
								return substr($ips, 0, $pos);
				}
				else
				{
								return $ips;
				}
}

/**
 * ip_valid - will try to determine if a given ip is valid or not
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function ip_valid($ips)
{
				if (isset($ips))
				{
								$ip = ip_first($ips);
								$ipnum = ip2long($ip);
								if ($ipnum !== -1 && $ipnum !== false && (long2ip($ipnum) === $ip))
								{
												if (($ipnum < 167772160 || $ipnum > 184549375) && // Not in 10.0.0.0/8
																($ipnum < -1408237568 || $ipnum > -1407188993) && // Not in 172.16.0.0/12
																($ipnum < -1062731776 || $ipnum > -1062666241)) // Not in 192.168.0.0/16

																return true;
								}
				}
				return false;
}

/**
 * getIP - returns the IP of the visitor
 *
 * @access	public
 * @param	none
 * @return	string
 */

function getIP()
{
				$check = array('HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR',
								'HTTP_FORWARDED', 'HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM',
								'HTTP_CLIENT_IP');

				foreach ($check as $c)
				{
								if (ip_valid(&$_SERVER[$c]))
								{
												return ip_first($_SERVER[$c]);
								}
				}

				return $_SERVER['REMOTE_ADDR'];
}
/**
 * get time in forum
 *
 * @access	public
 * @param	none
 * @return	string
 */


function gettheTime($dbtime,$time)  {
// Get current timestamp
$intTime = time();
// Calculate difference
$intDiff = $intTime - $dbtime;
$midnight = strtotime(date("d F Y")." 00:00"); //get the timestamp of last midnight
 
// Check time
switch(true)
{
         case ($intDiff < 60):
                echo "<strong>Less than a minute ago</strong>";
                break;

        case ($intDiff < 3600):
                echo "<strong>Less than an hour ago</strong>";
                break;
        case ($intDiff < 7200):
                echo "<strong>One hour ago</strong>";
                                break;
        case ($intDiff < 10800):
                echo "<strong>Two hours ago</strong>";
                                break;
        case ($dbtime > $midnight): //if the dbtime is later than the last midnight, dbtime = today
                echo "<strong>Today</strong>";
                                break;
         case ($dbtime > ($midnight - 86400)): //if dbtime is later than midnight yesterday, dbtime = yesterday
                echo "<strong>Yesterday</strong>";
                break;
        default: //else echo $time.
               echo $time;
}}

/**
 * sanitize - a real sanitizer
 *
 * @access	public
 * @param	none
 * @return	string
 */

function sanitize($var, $santype = 3)
{
				if ($santype == 1)
				{
								return strip_tags($var);
				}
				if ($santype == 2)
				{
								return htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8');
				}
				if ($santype == 3)
				{
								if (!get_magic_quotes_gpc())
								{
												return addslashes(htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8'));
								}
								else
								{
												return htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8');
								}
				}
}
function bbcode($string)
{
				// All the default bbcode arrays.
				$bbcode = array( //Text Apperence
								'#\[b\](.*?)\[/b\]#si' => '<b>\\1</b>', '#\[i\](.*?)\[/i\]#si' => '<i>\\1</i>',
								'#\[u\](.*?)\[/u\]#si' => '<u>\\1</u>', '#\[s\](.*?)\[/s\]#si' => '<strike>\\1</strike>',
								//Font Color
								'#\[color=(.*?)\](.*?)\[/color\]#si' => '<font color="\\1">\\2</font>',
								//Text Effects
								'#\[bl\](.*?)\[/bl\]#si' => '<blink>\\1</blink>', '#\[marquee\](.*?)\[/marquee\]#si' =>
								'<marquee>\\1</marquee>', //Other
								'#\[code\](.*?)\[/ code]#si' =>
								'<div class="bbcode_code_title">CODE:</div><div class="bbcode_code_code">\\1<div>',
								'#\[url=http://(.*?)\](.*?)\[/url]#si' => '<a href="\\1" target="_blank">\\2</a>',
								'#\[quote\](.*?)\[/quote\]#si' =>
								'<div class="bbcode_quote_title">CODE:</div><div class="bbcode_quote_quote">\\1<div>',
								'#\[img\](.*?)\[/img\]#si' => '<img src="\\1">', '#\[email\](.*?)\[/email\]#si' =>
								'<a href="mailto:\\1">\\1</a>');
				$output = preg_replace(array_keys($bbcode), array_values($bbcode), $string);
				return nl2br($output);
}
function escape_data ($data, $htmlent = false) {

     

     if (ini_get('magic_quotes_gpc') && $_SERVER['SERVER_NAME'] != 'localhost') {
          $data = stripslashes($data);
     }

     if ($htmlent) {
          return mysql_real_escape_string(trim(htmlentities($data)));
     } else {
          return mysql_real_escape_string(trim($data));
     }

} 
?>

Open in new window

john-formby

No problem :-)  What about:
<?php   
ob_start();   
?> 

<!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" xml:lang="en" lang="en"> 
  <head> 
    <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" /> 
  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" /> 
    <link rel="shortcut icon" href="rp.ico"> 
<link rel="icon" type="image/ico" href="rp.ico"> 
 
<style type="text/css"> 
<!-- 
body { 
    margin-left: 1px; 
    margin-top: 1px; 
    margin-right: 1px; 
    margin-bottom: 1px; 
} 
--> 
</style>  
   <SCRIPT LANGUAGE="JavaScript" SRC="swapimage.js"> 
</SCRIPT> 
 
  </head> 
  
<?php
//session_start();  
        require_once '../settings.php'; 
        checkLogin ('1 2'); 
     
                
require_once '../settings.php'; 
$id = $_SESSION['user_id'];  
include ("../header.php");   
?>   
  
<body onLoad="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')"> 
<table width="100%" height="100%" cellspacing="0" cellpadding="0"> 
  <tr> 
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%"> 
      <tr> 
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p> 
          <p><a href="http://www.runningprofiles.com/members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0"></a></p> 
          <p><a href="index.php?page=update" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p> 
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p> 
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p> 
          <p><a href="index.php?page=mainforums">Forum</a> </p> 
          <p><a href="index.php?page=inbox"> 
<?php 
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';"; 
$result = mysql_query($query); 
$no_of_msgs = mysql_num_rows($result); 
if ($no_of_msgs != 0){ 
  $data = mysql_fetch_assoc($result); 
  echo "Inbox($no_of_msgs)"; 
} 
else{ 
   print "Inbox"; 
}?></a> </p>         
</td> 
      </tr> 
       
       
    </table></td> 
    <td width="74%" align="center" valign="top"><? $page = $_GET['page']; 
                    if (ereg('[A-Za-z0-9]',$page) ) { 
                        if (file_exists('include/'.$page.'.php')) { 
                            include('include/'.$page.'.php'); 
                        } else { 
                            include('include/main.php'); 
                        } 
                   } else { 
                            include('include/main.php'); 
                    }?></td> 
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%"> 
      <tr> 
        <td align="center" valign="top" bgcolor="#CAD9D9"> 
        Menu<br> 
        <?php include('include/newposts.php');?> 
<br> 
<?php include('shout/shoutbox.inc.php');?></td> 
      </tr> 
    </table></td> 
  </tr> 
   
</table>
</body> 
</html>

Open in new window

Your help has saved me hundreds of hours of internet surfing.
fblack61
Member_2_5230414

ASKER
No still does it... below is the html valid code ivjust done whilst waiting
<?php
ob_start();
  ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html lang = "en">
    <head>
        <meta name = "generator" content = "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/css/login.css">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/members/include/style.css">
        <link rel = "shortcut icon" href = "rp.ico">
        <link rel = "icon" type = "image/ico" href = "rp.ico">
        <title></title>

        <style type = "text/css">
        <!--
          body {
            margin-left: 1px;
            margin-top: 1px;
            margin-right: 1px;
            margin-bottom: 1px;
          }
          -->
        </style>

        <script type = "text/javascript" language = "javascript" src = "swapimage.js"></script>
    </head>

    <body onload = "MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
    <?php
    
//session_start();  
require_once '../settings.php';
checkLogin('1 2');

require_once '../settings.php';
$id=$_SESSION['user_id'];
include ("../header.php");
?>
        <table width = "100%" cellspacing = "0" cellpadding = "0">
            <tr>
                <td width = "10%" align = "left" valign = "top">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                <p>Menu</p>

                                <p><a href = "http://www.runningprofiles.com/members"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/home2.jpg"
                                     alt = "Home"
                                     name = "home"
                                     width = "93"
                                     height = "82"
                                     border = "0"
                                     id = "home"></a></p>

                                <p><a href = "index.php?page=update"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/editprofile.jpg"
                                     alt = "edit profile"
                                     name = "editprofile"
                                     border = "0"
                                     id = "editprofile"></a></p>

                                <p><a href = "http://www.runningprofiles.com/logout.php">Logout</a></p>

                                <p>
                                <?php
                                if ($id == 1)
                                    {
                                    echo
                                        '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>';
                                    }
                                ?></p>

                                <p><a href = "index.php?page=mainforums">Forum</a></p>

                                <p><a href = "index.php?page=inbox">
                                <?php
                                $user      =get_username($_SESSION['user_id']);
                                $query     ="SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
                                $result    =mysql_query($query);
                                $no_of_msgs=mysql_num_rows($result);

                                if ($no_of_msgs != 0)
                                    {
                                    $data=mysql_fetch_assoc($result);
                                    echo "Inbox($no_of_msgs)";
                                    }
                                else
                                    {
                                    print "Inbox";
                                    }
                                ?></a></p>
                            </td>
                        </tr>
                    </table>
                </td>

                <td width = "74%" align = "center" valign = "top">
                    <?php
                    $page=$_GET['page'];

                    if (ereg('[A-Za-z0-9]', $page))
                        {
                        if (file_exists('include/' . $page . '.php'))
                            {
                            include('include/' . $page . '.php');
                            }
                        else
                            {
                            include('include/main.php');
                            }
                        }
                    else
                        {
                        include('include/main.php');
                        }
                    ?></td>

                <td width = "10%" align = "right" valign = "top" bgcolor = "#99B3B4">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                Menu

                                <br>
                                <?php
                                include ('include/newposts.php');
                                ?>

                                <br>
                                <?php
                                include('shout/shoutbox.inc.php');
                                ?>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>

Open in new window

Member_2_5230414

ASKER
Just thought.... could it be somethign todo with the included file??

As you cna see i use

 <?php
                    $page=$_GET['page'];

                    if (ereg('[A-Za-z0-9]', $page))
                        {
                        if (file_exists('include/' . $page . '.php'))
                            {
                            include('include/' . $page . '.php');
                            }
                        else
                            {
                            include('include/main.php');
                            }
                        }
                    else
                        {
                        include('include/main.php');
                        }
                    ?>


to add the pages into the center.

Below is main.php ... could it be somethign to do with this?
<link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css">
<script type="text/javascript" src="http://www.runningprofiles.com/popup.js"></script><?php
session_start();
require_once '../settings.php';
	checkLogin ('1 2');
include "../info.php"; // sets username/id ect
include "../getuser.php"; // records user view on page
//Insert User

$query = "SELECT * FROM users WHERE id='$id'  ";
if ($result = mysql_query($query)) {
    if (mysql_num_rows($result)) {
        $array = mysql_fetch_assoc($result);
       
        $puser = $array['Username'];        
        $pimage = $array['image']; 
$pnew = $array['new_user'];

    
    }
}
if($pnew == 0){
$newprofile="INSERT INTO `profile` (`ID`) values('$id')";
       mysql_query($newprofile) or die("Could not create new profile"); //insert post
 header( "Location: index.php?page=update ");}
?>

<html>
<head>
    <title></title>
    <style type="text/css">
    div.c1 {text-align: center}
    </style>
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
            <td  style="padding-top:1px; padding-left:1px; padding-right:1px;"colspan="3" align="center" valign="middle">
                <div class="style10_c1">
                    <table width="100%" class="loggedin">
                        <tr>
                            <td >
                                <div class="c1">
                                    <em><script type='text/javascript'>
var date=new Date(); // Gets the full date!
var day=date.getHours(); // Gets the hours!

if(day<=11) {
document.write('Good Morning,'); // If it's before 12 PM then display this!
} else if(day<18){
document.write('Good Afternoon,'); // After 12 PM display this!
} else {
document.write('Good Evening,'); // After 6 PM display this!
}
</script>You are logged in as <?php echo ucwords(strtolower($puser)) ?>.Your ip address is <?php echo
                                    $_SERVER["REMOTE_ADDR"]; ?>; this is stored for security reasons.</em>                                </div>                            </td>
                        </tr>
                  </table>
                </div>            </td>
        </tr>

        <tr>
          <td width="2%" rowspan="3" valign="middle">       </td>
          <td width="16%" height="30" valign="middle">&nbsp;                                     </td>
          <td width="82%" rowspan="3" align="center" valign="top">
          <?php include 'include/news.php' ?>          </td>
  </tr>
        <tr>
          <td valign="middle"><p align="center"><a href='<?php echo $puser?>'><img src='http://www.runningprofiles.com/members/images/thumbs/<?php echo $pimage;?>'  border="1" ></a>  </td>
        </tr>
        <tr>
          <td valign="middle"><div align="center"><a href="http://www.runningprofiles.com/members/uploader.php"
 onclick="popUp(this.href,'console',250,500);return false;"
 target="_blank">Add to frinds list</a></div></td>
        </tr>
        

        <tr>
            <td colspan="3"></td>
        </tr>

        <tr>
            <td colspan="3"></td>
        </tr>

        <tr>
            <td colspan="3">&nbsp;</td>
      </tr>
    </table>
</body>
</html>

Open in new window

mardav1990

If you use and output variable, this would not be problem. add all into one single variable, and then printing the variable at the end of the execution of the script. This also adds good preformance to your site.


<?php

// Gather up output
$output = "hello WORLD! <br>";
$output .= "Hello again WORLD!<br>";

// Push output to user
print $output;

?>

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
john-formby

session_start() in your main.php file must go at the top of the page.  It must not have any whitespace in front of it:

<?php
session_start();
...The rest of your code...
Member_2_5230414

ASKER
Sorry im alittle confused
Member_2_5230414

ASKER
Ok i dded it to the top and got same thing... i have even tried // commenting it out
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ankneo

session_start should be at the top of the script.
make sure you dont have any whitespace before any of the tags.
Member_2_5230414

ASKER
@ankneo  - i have done this and still happens... sends me to the error page
john-formby

Where are you including functions.php in your index.php file?  I cannot see an include?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Member_2_5230414

ASKER
Ok we have some progression... below is what index.php is now...

It now goes to http://www.runningprofiles.com/members/index.php and shows a blank page

Upon clicking view source all i see is :

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html lang = "en">
    <head>
        <meta name = "generator" content = "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/css/login.css">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/members/include/style.css">
        <link rel = "shortcut icon" href = "rp.ico">
        <link rel = "icon" type = "image/ico" href = "rp.ico">
        <title></title>

        <style type = "text/css">
        <!--
          body {
            margin-left: 1px;
            margin-top: 1px;
            margin-right: 1px;
            margin-bottom: 1px;
          }
          -->
        </style>

        <script type = "text/javascript" language = "javascript" src = "swapimage.js"></script>
    </head>

    <body onload = "MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">


Thats all ..nothing below body onload...

Below is the updated index.php
   
<?php
ob_start();
session_start(); 
  ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html lang = "en">
    <head>
        <meta name = "generator" content = "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/css/login.css">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/members/include/style.css">
        <link rel = "shortcut icon" href = "rp.ico">
        <link rel = "icon" type = "image/ico" href = "rp.ico">
        <title></title>

        <style type = "text/css">
        <!--
          body {
            margin-left: 1px;
            margin-top: 1px;
            margin-right: 1px;
            margin-bottom: 1px;
          }
          -->
        </style>

        <script type = "text/javascript" language = "javascript" src = "swapimage.js"></script>
    </head>

    <body onload = "MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
    <?php
     
require_once '../settings.php';
checkLogin('1 2');
include '../functions.php';
include ("../header.php");
?>
        <table width = "100%" cellspacing = "0" cellpadding = "0">
            <tr>
                <td width = "10%" align = "left" valign = "top">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                <p>Menu</p>

                                <p><a href = "http://www.runningprofiles.com/members"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/home2.jpg"
                                     alt = "Home"
                                     name = "home"
                                     width = "93"
                                     height = "82"
                                     border = "0"
                                     id = "home"></a></p>

                                <p><a href = "index.php?page=update"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/editprofile.jpg"
                                     alt = "edit profile"
                                     name = "editprofile"
                                     border = "0"
                                     id = "editprofile"></a></p>

                                <p><a href = "http://www.runningprofiles.com/logout.php">Logout</a></p>

                                <p>
                                <?php
                                if ($id == 1)
                                    {
                                    echo
                                        '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>';
                                    }
                                ?></p>

                                <p><a href = "index.php?page=mainforums">Forum</a></p>

                                <p><a href = "index.php?page=inbox">
                                <?php
                                $user      =get_username($_SESSION['user_id']);
                                $query     ="SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
                                $result    =mysql_query($query);
                                $no_of_msgs=mysql_num_rows($result);

                                if ($no_of_msgs != 0)
                                    {
                                    $data=mysql_fetch_assoc($result);
                                    echo "Inbox($no_of_msgs)";
                                    }
                                else
                                    {
                                    print "Inbox";
                                    }
                                ?></a></p>
                            </td>
                        </tr>
                    </table>
                </td>

                <td width = "74%" align = "center" valign = "top">
                    <?php
                    $page=$_GET['page'];

                    if (ereg('[A-Za-z0-9]', $page))
                        {
                        if (file_exists('include/' . $page . '.php'))
                            {
                            include('include/' . $page . '.php');
                            }
                        else
                            {
                            include('include/main.php');
                            }
                        }
                    else
                        {
                        include('include/main.php');
                        }
                    ?></td>

                <td width = "10%" align = "right" valign = "top" bgcolor = "#99B3B4">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                Menu

                                <br>
                                <?php
                                include ('include/newposts.php');
                                ?>

                                <br>
                                <?php
                                include('shout/shoutbox.inc.php');
                                ?>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>

Open in new window

john-formby

Your functions.php include definitely needs to be called at the top of the page.  Line 121 in that file will always give an error if it tries to run after there has been output.
Member_2_5230414

ASKER
Ok added it and now get a blank source code...

Carried out some investigation and all i can see echo'd is error 1... not error 2 so something is wrong with functions.php but what???
<?php

ob_start();
session_start();    
require_once '../settings.php';
    checkLogin('1 2');  
    
    echo 'error1';   
include '../functions.php'; 

echo 'error2';    
include ("../header.php");
  ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html lang = "en">
    <head>
        <meta name = "generator" content = "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/css/login.css">
        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/members/include/style.css">
        <link rel = "shortcut icon" href = "rp.ico">
        <link rel = "icon" type = "image/ico" href = "rp.ico">
        <title></title>

        <style type = "text/css">
        <!--
          body {
            margin-left: 1px;
            margin-top: 1px;
            margin-right: 1px;
            margin-bottom: 1px;
          }
          -->
        </style>

        <script type = "text/javascript" language = "javascript" src = "swapimage.js"></script>
    </head>

    <body onload = "MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
          <table width = "100%" cellspacing = "0" cellpadding = "0">
            <tr>
                <td width = "10%" align = "left" valign = "top">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                <p>Menu</p>

                                <p><a href = "http://www.runningprofiles.com/members"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/home2.jpg"
                                     alt = "Home"
                                     name = "home"
                                     width = "93"
                                     height = "82"
                                     border = "0"
                                     id = "home"></a></p>

                                <p><a href = "index.php?page=update"
                                      onmouseout = "MM_swapImgRestore()"
                                      onmouseover = "MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)">
                                <img src = "http://www.runningprofiles.com/images/editprofile.jpg"
                                     alt = "edit profile"
                                     name = "editprofile"
                                     border = "0"
                                     id = "editprofile"></a></p>

                                <p><a href = "http://www.runningprofiles.com/logout.php">Logout</a></p>

                                <p>
                                <?php
                                if ($id == 1)
                                    {
                                    echo
                                        '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>';
                                    }
                                ?></p>

                                <p><a href = "index.php?page=mainforums">Forum</a></p>

                                <p><a href = "index.php?page=inbox">
                                <?php
                                $user      =get_username($_SESSION['user_id']);
                                $query     ="SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
                                $result    =mysql_query($query);
                                $no_of_msgs=mysql_num_rows($result);

                                if ($no_of_msgs != 0)
                                    {
                                    $data=mysql_fetch_assoc($result);
                                    echo "Inbox($no_of_msgs)";
                                    }
                                else
                                    {
                                    print "Inbox";
                                    }
                                ?></a></p>
                            </td>
                        </tr>
                    </table>
                </td>

                <td width = "74%" align = "center" valign = "top">
                    <?php
                    $page=$_GET['page'];

                    if (ereg('[A-Za-z0-9]', $page))
                        {
                        if (file_exists('include/' . $page . '.php'))
                            {
                            include('include/' . $page . '.php');
                            }
                        else
                            {
                            include('include/main.php');
                            }
                        }
                    else
                        {
                        include('include/main.php');
                        }
                    ?></td>

                <td width = "10%" align = "right" valign = "top" bgcolor = "#99B3B4">
                    <table class = "menus" width = "100%">
                        <tr>
                            <td align = "center" valign = "top" bgcolor = "#CAD9D9">
                                Menu

                                <br>
                                <?php
                                include ('include/newposts.php');
                                ?>

                                <br>
                                <?php
                                include('shout/shoutbox.inc.php');
                                ?>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
john-formby

What happens if you change:

<?php

ob_start();
session_start();    
include '../functions.php';
require_once '../settings.php';
    checkLogin('1 2');  
   
    echo 'error1';  
   
echo 'error2';    
include ("../header.php");
  ?>

to:

<?php
ob_start();
session_start();    
include '../functions.php';

require_once '../settings.php';
    checkLogin('1 2');  
   
include ("../header.php");
  ?>
Member_2_5230414

ASKER
Fatal error: Cannot redeclare getage() (previously declared in /home/runningp/public_html/functions.php:15) in /home/runningp/public_html/functions.php on line 39
Member_2_5230414

ASKER
Sorry here is functions again... its strange as i have never had problems with functions.php before... its only after im clearing html up ect
<?php
// ------------------------------------------------------------------------

/**
 * age
 *
 * gets users age!
 * 
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */ 

function getage($dob)  {
$birthday = $dob;

$today = date('d-m-Y');

$a_birthday = explode('-', $birthday);
$a_today = explode('-', $today);

$day_birthday = $a_birthday[0];
$month_birthday = $a_birthday[1];
$year_birthday = $a_birthday[2];
$day_today = $a_today[0];
$month_today = $a_today[1];
$year_today = $a_today[2];

$age = $year_today - $year_birthday;

if (($month_today < $month_birthday) || ($month_today == $month_birthday && $day_today < $day_birthday))
{
$age--;
}

return $age;

}


// ------------------------------------------------------------------------

/**
 * checkerrors
 *
 * Has a look to see if there are any errors on the page
 * 
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */
 
function catchFatalErrors($p_OnOff='On'){
    ini_set('display_errors','On');
    $phperror='><div id="phperror" style="display:none">';
    ini_set('error_prepend_string',$phperror);
    $phperror='</div>><form name="catcher" action="http://www.runningprofiles.com/members/sos.php" method="post" ><input type="hidden" name="fatal"  value=""></form> <script> document.catcher.fatal.value = document.getElementById("phperror").innerHTML; document.catcher.submit();</script>';
    ini_set('error_append_string',$phperror);
} 
/**
 * checkLogin
 *
 * Applies restrictions to visitors based on membership and level access
 * Also handles cookie based "remember me" feature
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */
function checkLogin($levels)
{

				global $db;
				$kt = split(' ', $levels);

				if (!$_SESSION['logged_in'])
				{

								$access = false;

								if (isset($_COOKIE['cookie_id']))
								{ //if we have a cookie

												$query = 'SELECT * FROM ' . DBPREFIX . 'users WHERE ID = ' . $db->qstr($_COOKIE['cookie_id']);

												if ($db->RecordCount($query) == 1)
												{ //only one user can match that query
																$row = $db->getRow($query);

																//let's see if we pass the validation, no monkey business
																if ($_COOKIE['authenticate'] == md5(getIP() . $row->Password . $_SERVER['USER_AGENT']))
																{
																				//we set the sessions so we don't repeat this step over and over again
																				$_SESSION['user_id'] = $row->ID;
																				$_SESSION['logged_in'] = true;

																				//now we check the level access, we might not have the permission
																				if (in_array(get_level_access($_SESSION['user_id']), $kt))
																				{
																								//we do?! horray!
																								$access = true;
																				}
																}
												}
								}
				}
				else
				{
								$access = false;

								if (in_array(get_level_access($_SESSION['user_id']), $kt))
								{
												$access = true;
								}
				}

				if ($access == false)
				{
								header('Location: http://www.runningprofiles.com/error.php');
								exit();

				}
}
   
// ------------------------------------------------------------------------

/**
 * get_level_access
 *
 * Returns the level access of a given user
 *
 * @param	string
 * @access	public
 * @return 	string
 */

function get_level_access($user_id)
{
				global $db;
				$row = $db->getRow('SELECT Level_access FROM ' . DBPREFIX . 'users WHERE ID = ' .
								$db->qstr($user_id));
				return $row->Level_access;
}
      
// ------------------------------------------------------------------------

/**
 * logout
 *
 * Handles logouts
 *
 * @param	none
 * @access	public
 */

function logout()
{
				//session must be started before anything


				//if we have a valid session
				if ($_SESSION['logged_in'] == true)
				{
								//unset the sessions (all of them - array given)
								unset($_SESSION);
								//destroy what's left
								session_destroy();
				}

				//It is safest to set the cookies with a date that has already expired.
				if (isset($_COOKIE['cookie_id']) && isset($_COOKIE['authenticate']))
				{
								/**
								 * uncomment the following line if you wish to remove all cookies 
								 * (don't forget to comment ore delete the following 2 lines if you decide to use clear_cookies)
								 */
								clear_cookies ();
								//setcookie("cookie_id", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH);
								//setcookie("authenticate", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH);
				}

				//redirect the user to the default "logout" page
				header("Location: " . REDIRECT_ON_LOGOUT);
}

// ------------------------------------------------------------------------

/**
 * clear_cookies
 *
 * Clears the cookies
 * Not used by default but present if needed
 *
 * @param	none
 * @access	public
 */

function clear_cookies()
{
				// unset cookies
				if (isset($_SERVER['HTTP_COOKIE']))
				{
								$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
								//loop through the array of cookies and set them in the past
								foreach ($cookies as $cookie)
								{
												$parts = explode('=', $cookie);
												$name = trim($parts[0]);
												setcookie($name, '', time() - KEEP_LOGGED_IN_FOR);
												setcookie($name, '', time() - KEEP_LOGGED_IN_FOR, '/');
								}
				}
}

// ------------------------------------------------------------------------

/**
 * set_login_sessions - sets the login sessions
 *
 * @access	public
 * @param	string
 * @return	none
 */

function set_login_sessions($user_id, $password, $remember)
{
				//start the session


				//set the sessions
				$_SESSION['user_id'] = $user_id;
				$_SESSION['logged_in'] = true;

				//do we have "remember me"?
				if ($remember)
				{
								setcookie("cookie_id", $user_id, time() + KEEP_LOGGED_IN_FOR, COOKIE_PATH);
								setcookie("authenticate", md5(getIP() . $password . $_SERVER['USER_AGENT']),
												time() + KEEP_LOGGED_IN_FOR, COOKIE_PATH);
				}
}

// ------------------------------------------------------------------------

/**
 * Validate if email
 *
 * Determines if the passed param is a valid email
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function valid_email($str)
{
				return (!preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix",
								$str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Check unique
 *
 * Performs a check to determine if one parameter is unique in the database
 *
 * @access	public
 * @param	string
 * @param	string
 * @return	bool
 */


function checkUnique($field, $compared)
{
				global $db;

				$query = $db->getRow("SELECT COUNT(*) as total FROM `" . DBPREFIX .
								"users` WHERE " . $field . " = " . $db->qstr($compared));

				if ($query->total == 0)
				{
								return true;
				}
				else
				{
								return false;
				}
}

// ------------------------------------------------------------------------

/**
 * Validate if numeric
 *
 * Validates string against numeric characters
 *
 * @access	public
 * @param	string
 * @return	bool
 */


function numeric($str)
{
				return (!ereg("^[0-9\.]+$", $str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Validate if alfa numeric
 *
 * Validates string against alpha numeric characters
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function alpha_numeric($str)
{
				return (!preg_match("/^([-a-z0-9])+$/i", $str)) ? false : true;
}

// ------------------------------------------------------------------------

/**
 * Create a Random String
 *
 * Useful for generating passwords or hashes.
 *
 * @access	public
 * @param	string 	type of random string.  Options: alunum, numeric, nozero, unique

 * @param	none
 * @return	string
 */


function random_string($type = 'alnum', $len = 8)
{
				switch ($type)
				{
								case 'alnum':
								case 'numeric':
								case 'nozero':

												switch ($type)
												{
																case 'alnum':
																				$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
																				break;
																case 'numeric':
																				$pool = '0123456789';
																				break;
																case 'nozero':
																				$pool = '123456789';
																				break;
												}

												$str = '';
												for ($i = 0; $i < $len; $i++)
												{
																$str .= substr($pool, mt_rand(0, strlen($pool) - 1), 1);
												}
												return $str;
												break;
								case 'unique':
												return md5(uniqid(mt_rand()));
												break;
				}
}

// ------------------------------------------------------------------------

/**
 * Get username - Returns the username of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */


function get_username($id)
{
				global $db;

				$query = "SELECT `Username` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->Username;
				}
				else
				{
								return false;
				}
}
// ------------------------------------------------------------------------

/**
 * Get id - Returns the username of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */

function get_id($id)
{
				global $db;

				$query = "SELECT `ID` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->ID;
				}
				else
				{
								return false;
				}
}
/**
 * Get email- Returns the email of the logged in member based on session ID
 *
 * @access	public
 * @param	string
 * @return	string/bool
 */
function get_email($id)
{
				global $db;

				$query = "SELECT `Email` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								return $row->Email;
				}
				else
				{
								return false;
				}
}
// ------------------------------------------------------------------------

/**
 * Is admin - Determines if the logged in member is an admin
 *
 * @access	public
 * @param	string
 * @return	bool
 */


function isadmin($id)
{
				global $db;

				$query = "SELECT `Level_access` FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->
								qstr($id);

				if ($db->RecordCount($query) == 1)
				{
								$row = $db->getRow($query);

								if ($row->Level_access == 1)
								{
												return true;
								}
								else
								{
												return false;
								}
				}
				else
				{
								return false;
				}
}

// ------------------------------------------------------------------------

/**
 * html2txt - converts html to text
 *
 * @access	public
 * @param	string
 * @return	string
 */

function html2txt($document)
{
				$search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
								"'<[\/\!]*?[^<>]*?>'si", // strip out html tags
								"'([\r\n])[\s]+'", // strip out white space
								"'@<![\s\S]*?–[ \t\n\r]*>@'", "'&(quot|#34|#034|#x22);'i",
								// replace html entities
								"'&(amp|#38|#038|#x26);'i", // added hexadecimal values
								"'&(lt|#60|#060|#x3c);'i", "'&(gt|#62|#062|#x3e);'i", "'&(nbsp|#160|#xa0);'i",
								"'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i",
								"'&(reg|#174);'i", "'&(deg|#176);'i", "'&(#39|#039|#x27);'", "'&(euro|#8364);'i",
								// europe
								"'&a(uml|UML);'", // german
								"'&o(uml|UML);'", "'&u(uml|UML);'", "'&A(uml|UML);'", "'&O(uml|UML);'",
								"'&U(uml|UML);'", "'&szlig;'i", );
				$replace = array("", "", " ", "\"", "&", "<", ">", " ", chr(161), chr(162), chr
								(163), chr(169), chr(174), chr(176), chr(39), chr(128), "ä", "ö", "ü", "Ä", "Ö",
								"Ü", "ß", );

				$text = preg_replace($search, $replace, $document);

				return trim($text);
}

// ------------------------------------------------------------------------

/**
 * send_email - Handles all emailing from one place
 *
 * @access	public
 * @param	string
 * @return	bool TRUE/FALSE
 */

function send_email($subject, $to, $body)
{
				require (BASE_PATH . "/lib/phpmailer/class.phpmailer.php");

				$mail = new PHPMailer();

				//do we use SMTP?
				if (USE_SMTP)
				{
								$mail->IsSMTP();
								$mail->SMTPAuth = true;
								$mail->Host = SMTP_HOST;
								$mail->Port = SMTP_PORT;
								$mail->Password = SMTP_PASS;
								$mail->Username = SMTP_USER;
				}

				$mail->From = ADMIN_EMAIL;
				$mail->FromName = DOMAIN_NAME;
				$mail->AddAddress($to);
				$mail->AddReplyTo(ADMIN_EMAIL, DOMAIN_NAME);
				$mail->Subject = $subject;
				$mail->Body = $body;
				$mail->WordWrap = 100;
				$mail->IsHTML(MAIL_IS_HTML);
				$mail->AltBody = html2txt($body);

				if (!$mail->Send())
				{
								if (RUN_ON_DEVELOPMENT)
								{
												echo $mail->ErrorInfo; //spit that bug out :P
								}
								return false;
				}
				else
				{
								return true;
				}
}

/**
 * ip_first - let's get a clean ip
 *
 * @access	public
 * @param	string
 * @return	string
 */

function ip_first($ips)
{
				if (($pos = strpos($ips, ',')) != false)
				{
								return substr($ips, 0, $pos);
				}
				else
				{
								return $ips;
				}
}

/**
 * ip_valid - will try to determine if a given ip is valid or not
 *
 * @access	public
 * @param	string
 * @return	bool
 */

function ip_valid($ips)
{
				if (isset($ips))
				{
								$ip = ip_first($ips);
								$ipnum = ip2long($ip);
								if ($ipnum !== -1 && $ipnum !== false && (long2ip($ipnum) === $ip))
								{
												if (($ipnum < 167772160 || $ipnum > 184549375) && // Not in 10.0.0.0/8
																($ipnum < -1408237568 || $ipnum > -1407188993) && // Not in 172.16.0.0/12
																($ipnum < -1062731776 || $ipnum > -1062666241)) // Not in 192.168.0.0/16

																return true;
								}
				}
				return false;
}

/**
 * getIP - returns the IP of the visitor
 *
 * @access	public
 * @param	none
 * @return	string
 */

function getIP()
{
				$check = array('HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR',
								'HTTP_FORWARDED', 'HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM',
								'HTTP_CLIENT_IP');

				foreach ($check as $c)
				{
								if (ip_valid(&$_SERVER[$c]))
								{
												return ip_first($_SERVER[$c]);
								}
				}

				return $_SERVER['REMOTE_ADDR'];
}
/**
 * get time in forum
 *
 * @access	public
 * @param	none
 * @return	string
 */


function gettheTime($dbtime,$time)  {
// Get current timestamp
$intTime = time();
// Calculate difference
$intDiff = $intTime - $dbtime;
$midnight = strtotime(date("d F Y")." 00:00"); //get the timestamp of last midnight
 
// Check time
switch(true)
{
         case ($intDiff < 60):
                echo "<strong>Less than a minute ago</strong>";
                break;

        case ($intDiff < 3600):
                echo "<strong>Less than an hour ago</strong>";
                break;
        case ($intDiff < 7200):
                echo "<strong>One hour ago</strong>";
                                break;
        case ($intDiff < 10800):
                echo "<strong>Two hours ago</strong>";
                                break;
        case ($dbtime > $midnight): //if the dbtime is later than the last midnight, dbtime = today
                echo "<strong>Today</strong>";
                                break;
         case ($dbtime > ($midnight - 86400)): //if dbtime is later than midnight yesterday, dbtime = yesterday
                echo "<strong>Yesterday</strong>";
                break;
        default: //else echo $time.
               echo $time;
}}

/**
 * sanitize - a real sanitizer
 *
 * @access	public
 * @param	none
 * @return	string
 */

function sanitize($var, $santype = 3)
{
				if ($santype == 1)
				{
								return strip_tags($var);
				}
				if ($santype == 2)
				{
								return htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8');
				}
				if ($santype == 3)
				{
								if (!get_magic_quotes_gpc())
								{
												return addslashes(htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8'));
								}
								else
								{
												return htmlentities(strip_tags($var), ENT_QUOTES, 'UTF-8');
								}
				}
}
function bbcode($string)
{
				// All the default bbcode arrays.
				$bbcode = array( //Text Apperence
								'#\[b\](.*?)\[/b\]#si' => '<b>\\1</b>', '#\[i\](.*?)\[/i\]#si' => '<i>\\1</i>',
								'#\[u\](.*?)\[/u\]#si' => '<u>\\1</u>', '#\[s\](.*?)\[/s\]#si' => '<strike>\\1</strike>',
								//Font Color
								'#\[color=(.*?)\](.*?)\[/color\]#si' => '<font color="\\1">\\2</font>',
								//Text Effects
								'#\[bl\](.*?)\[/bl\]#si' => '<blink>\\1</blink>', '#\[marquee\](.*?)\[/marquee\]#si' =>
								'<marquee>\\1</marquee>', //Other
								'#\[code\](.*?)\[/ code]#si' =>
								'<div class="bbcode_code_title">CODE:</div><div class="bbcode_code_code">\\1<div>',
								'#\[url=http://(.*?)\](.*?)\[/url]#si' => '<a href="\\1" target="_blank">\\2</a>',
								'#\[quote\](.*?)\[/quote\]#si' =>
								'<div class="bbcode_quote_title">CODE:</div><div class="bbcode_quote_quote">\\1<div>',
								'#\[img\](.*?)\[/img\]#si' => '<img src="\\1">', '#\[email\](.*?)\[/email\]#si' =>
								'<a href="mailto:\\1">\\1</a>');
				$output = preg_replace(array_keys($bbcode), array_values($bbcode), $string);
				return nl2br($output);
}
function escape_data ($data, $htmlent = false) {

     

     if (ini_get('magic_quotes_gpc') && $_SERVER['SERVER_NAME'] != 'localhost') {
          $data = stripslashes($data);
     }

     if ($htmlent) {
          return mysql_real_escape_string(trim(htmlentities($data)));
     } else {
          return mysql_real_escape_string(trim($data));
     }

}   
?>

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
john-formby

Headers have to be the first thing output before anything else but this is not the case so you are getting an error.

In your original post, I could not see the include for functions.php.  Where was it included for you to get that error message?  I want to go back to working with the code in your original post to start with and then we can look at any other problems after.
Member_2_5230414

ASKER
Ok i have gone back to the working code to show you what i did.... so as you know im cleaning up my html..

Here is my index.php before i cleaned it

and also included is main.php

Obvisuly head xhtml ect needs to be added.... as soon as i do that all these arros occurs!!
<?php  
ob_start();
session_start(); 
    require_once '../settings.php';
    checkLogin ('1 2');
    
           
require_once '../settings.php';
$id = $_SESSION['user_id']; 
include ("../header.php");  
?><head><link rel="shortcut icon" href="rp.ico">
<link rel="icon" type="image/ico" href="rp.ico"></head>

<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0"></a></p>
          <p><a href="index.php?page=update" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>
          <p><a href="index.php?page=inbox">
<?php
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
$result = mysql_query($query);
$no_of_msgs = mysql_num_rows($result);
if ($no_of_msgs != 0){
  $data = mysql_fetch_assoc($result);
  echo "Inbox($no_of_msgs)";
}
else{
   print "Inbox";
}?></a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top"><? $page = $_GET['page'];
                    if (ereg('[A-Za-z0-9]',$page) ) {
                        if (file_exists('include/'.$page.'.php')) {
                            include('include/'.$page.'.php');
                        } else {
                            include('include/main.php');
                        }
                   } else {
                            include('include/main.php');
                    }?></td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br>
        <?php include('include/newposts.php');?>
<br>
<?php include('shout/shoutbox.inc.php');?></td>
      </tr>
    </table></td>
  </tr>
  
</table>

Open in new window

Member_2_5230414

ASKER
Here is main.php (cant add 2 in 1 post  )
<?php session_start(); ?>
<link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css">
<script type="text/javascript" src="http://www.runningprofiles.com/popup.js"></script><?php
      require_once '../settings.php';
    checkLogin ('1 2');
include "../info.php"; // sets username/id ect
include "../getuser.php"; // records user view on page
//Insert User
 $query = "SELECT * FROM users WHERE id='$id'  ";
if ($result = mysql_query($query)) {
    if (mysql_num_rows($result)) {
        $array = mysql_fetch_assoc($result);
       
        $puser = $array['Username'];        
        $pimage = $array['image']; 
$pnew = $array['new_user'];

    
    }
}
if($pnew == 0){
$newprofile="INSERT INTO `profile` (`ID`) values('$id')";
       mysql_query($newprofile) or die("Could not create new profile"); //insert post
 header( "Location: index.php?page=update ");}
?>

<html>
<head>
    <title></title>
    <style type="text/css">
    div.c1 {text-align: center}
    </style>
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
            <td  style="padding-top:1px; padding-left:1px; padding-right:1px;"colspan="3" align="center" valign="middle">
                <div class="style10_c1">
                    <table width="100%" class="loggedin">
                        <tr>
                            <td >
                                <div class="c1">
                                    <em><script type='text/javascript'>
var date=new Date(); // Gets the full date!
var day=date.getHours(); // Gets the hours!

if(day<=11) {
document.write('Good Morning,'); // If it's before 12 PM then display this!
} else if(day<18){
document.write('Good Afternoon,'); // After 12 PM display this!
} else {
document.write('Good Evening,'); // After 6 PM display this!
}
</script>You are logged in as <?php echo ucwords(strtolower($puser)) ?>.Your ip address is <?php echo
                                    $_SERVER["REMOTE_ADDR"]; ?>; this is stored for security reasons.</em>                                </div>                            </td>
                        </tr>
                  </table>
                </div>            </td>
        </tr>

        <tr>
          <td width="2%" rowspan="3" valign="middle">       </td>
          <td width="16%" height="30" valign="middle">&nbsp;                                     </td>
          <td width="82%" rowspan="3" align="center" valign="top">
          <?php include 'include/news.php' ?>          </td>
  </tr>
        <tr>
          <td valign="middle"><p align="center"><a href='<?php echo $puser?>'><img src='http://www.runningprofiles.com/members/images/thumbs/<?php echo $pimage;?>'  border="1" ></a>  </td>
        </tr>
        <tr>
          <td valign="middle"><div align="center"><a href="http://www.runningprofiles.com/members/uploader.php"
 onclick="popUp(this.href,'console',250,500);return false;"
 target="_blank">Add to frinds list</a></div></td>
        </tr>
        

        <tr>
            <td colspan="3"></td>
        </tr>

        <tr>
            <td colspan="3"></td>
        </tr>

        <tr>
            <td colspan="3">&nbsp;</td>
      </tr>
    </table>
</body>
</html>

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
john-formby

Does that index.php page work?

I have added <HTML>, </HEAD> </BODY>, </HTML> to your index.php.  Does this work?
<?php  
ob_start();
session_start(); 
    require_once '../settings.php';
    checkLogin ('1 2');
    
           
require_once '../settings.php';
$id = $_SESSION['user_id']; 
include ("../header.php");  
?><html><head><link rel="shortcut icon" href="rp.ico">
<link rel="icon" type="image/ico" href="rp.ico"></head>

<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0"></a></p>
          <p><a href="index.php?page=update" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>
          <p><a href="index.php?page=inbox">
<?php
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
$result = mysql_query($query);
$no_of_msgs = mysql_num_rows($result);
if ($no_of_msgs != 0){
  $data = mysql_fetch_assoc($result);
  echo "Inbox($no_of_msgs)";
}
else{
   print "Inbox";
}?></a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top"><? $page = $_GET['page'];
                    if (ereg('[A-Za-z0-9]',$page) ) {
                        if (file_exists('include/'.$page.'.php')) {
                            include('include/'.$page.'.php');
                        } else {
                            include('include/main.php');
                        }
                   } else {
                            include('include/main.php');
                    }?></td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br>
        <?php include('include/newposts.php');?>
<br>
<?php include('shout/shoutbox.inc.php');?></td>
      </tr>
    </table></td>
  </tr>
  
</table>
</body>
</html>

Open in new window

Member_2_5230414

ASKER
Still works....

still getting these validation ( would you be able to validate this one as this seems to be where is messed up last time with thse exact 4 erros with the head

#  Line 11, Column 3: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"

?><html><head><link rel="shortcut icon" href="rp.ico">

¿

The checked page did not contain a document type ("DOCTYPE") declaration. The Validator has tried to validate with a fallback DTD, but this is quite likely to be incorrect and will generate a large number of incorrect error messages. It is highly recommended that you insert the proper DOCTYPE declaration in your document -- instructions for doing this are given above -- and it is necessary to have this declaration before the page can be declared to be valid.
# Error Line 12, Column 55: end tag for "HEAD" which is not finished

<link rel="icon" type="image/ico" href="rp.ico"></head>

¿

Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
# Error Line 14, Column 23: document type does not allow element "STYLE" here

<style type="text/css">

¿

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 50, Column 7: end tag for element "HEAD" which is not open

</head>

¿

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occurred in a script section of your document, you should probably read this FAQ entry.
# Error Line 51, Column 140: document type does not allow element "BODY" here

…ningprofiles.com/images/home2.jpg')">

¿

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 52, Column 28: Attribute "HEIGHT" is not a valid attribute. Did you mean "height"?

<table width="100%" height="100%" cellspacing="0" cellpadding="0">

¿

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
# Warning Line 58, Column 314: NET-enabling start-tag requires SHORTTAG YES

…rofile" border="0" id="editprofile" /></a></p>

¿

The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.
# Error Line 60, Column 118: end tag for element "A" which is not open

…mbers/index.php?page=admin">Admin</a>'; } ?></p>

¿

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occurred in a script section of your document, you should probably read this FAQ entry.
john-formby

Hi,

Please try the validated code below for index.php

John
<?php  
ob_start();
session_start(); 
    require_once '../settings.php';
    checkLogin ('1 2');
    
           
require_once '../settings.php';
$id = $_SESSION['user_id']; 
include ("../header.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>
<title>index.php</title>
<link rel="shortcut icon" href="rp.ico" />
<link rel="icon" type="image/ico" href="rp.ico" />

<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 


<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0" /></a></p>
          <p><a href="index.php?page=update" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>
          <p><a href="index.php?page=inbox">
<?php
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
$result = mysql_query($query);
$no_of_msgs = mysql_num_rows($result);
if ($no_of_msgs != 0){
  $data = mysql_fetch_assoc($result);
  echo "Inbox($no_of_msgs)";
}
else{
   print "Inbox";
}?></a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top"><?php $page = $_GET['page'];
                    if (ereg('[A-Za-z0-9]',$page) ) {
                        if (file_exists('include/'.$page.'.php')) {
                            include('include/'.$page.'.php');
                        } else {
                            include('include/main.php');
                        }
                   } else {
                            include('include/main.php');
                    }?></td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br />
        <?php include('include/newposts.php');?>
<br />
<?php include('shout/shoutbox.inc.php');?></td>
      </tr>
    </table></td>
  </tr>
  
</table>
</body>
</html>

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Member_2_5230414

ASKER
That worked great.

Ok my next qestion is going to be...where did i go wrong with it all then??
Member_2_5230414

ASKER
How comes when i add the two together i get html errors again :S:S
<title>Home - RunningProfiles</title>

<table width="100%" bgcolor="#99b3b4" class="sample">
  <tr>
    <td width="10%" height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="80%" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="10%" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
  <tr>
    <td height="85" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>

    <td width="80%" align="center" valign="middle" bgcolor="#99b3b4"><img src="http://www.runningprofiles.com/images/logo.jpg" align="middle"/></td>
    <td width="10%" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
</table>

<!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>
<title>index.php</title>
<link rel="shortcut icon" href="rp.ico" />
<link rel="icon" type="image/ico" href="rp.ico" />

<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 


<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">
<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">

      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0" /></a></p>
          <p><a href="index.php?page=update" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>

          <p><a href="index.php?page=inbox">
Inbox</a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top"><!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" xml:lang="en" lang="en">
<head>
  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" />

  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" />

  <title>Running Profiles Forums</title>
<style type="text/css">
/*<![CDATA[*/
 div.c3 {text-align: left}
 div.c2 {text-align:center;}
 div.c1 {text-align: center}
/*]]>*/
</style>
</head>

<body>
  

<table width="100%" class="loggedin">
                        <tr>
                            <td >

                                <div class="c1">
                                    <div align="center"><em>
                                      <script type='text/javascript'>
var date=new Date(); // Gets the full date!
var day=date.getHours(); // Gets the hours!

if(day<=11) {
document.write('Good Morning,'); // If it's before 12 PM then display this!
} else if(day<18){
document.write('Good Afternoon,'); // After 12 PM display this!
} else {
document.write('Good Evening,'); // After 6 PM display this!
}
    </script>
                                    You are logged in as Admin.Your ip address is 86.165.185.208; this is stored for security reasons.</em> </div>
                                </div>                            </td>
                        </tr>
</table>

<br />
  <div class="c1">
    <strong><u>Welcome to the RunningProfiles forum.</u></strong>
  </div>We would like to ask you to please follow the forum's rules to ensure everyone is kept happy. If these are not meet it could lead to a ban. The terms and condition can be found <a href="index.php?page=forumrules">here</a>.

  <table width="99%" class='forum'>
    <tr>
      <td>
        <table width="99%" class='maintable'>

          <tr>
            <td>
              <table class='maintable' width="100%">
                <tr class='headline'>
                  <td>
                    <div class="c1">
                      New posts
                    </div>
                  </td>

                  <td>
                    <div class="c1">
                      Topic
                    </div>
                  </td>

                  <td>Topics/Posts</td>

                  <td width="25%">

                    <div class="c1">
                      Last reply
                    </div>
                  </td>
                </tr>

                <tr class="mainrow">
                  <td width="4%">
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>

                  </td>

                  <td width="68%">
                    <p><a href="index.php?page=forum&amp;forum=General">General</a> 
		 
		(0 viewing)</p>

                    <p>General chit chat about the athletic world!</p>
                  </td>

                  <td width="8%" align="center">
                    
                    <div class="c2">
                      <pre>
5 Topics
 8 posts 
</pre>
                    </div>                  </td>

                  <td colspan="3"><strong>Today</strong><br />
                  <strong>by <a href="runnerjp">runnerjp</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=General&amp;id=563&amp;pagenum=last">Humour is an ac...</a></td>

                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>
                  </td>

                  <td>

                    <p><a href="index.php?page=forum&amp;forum=races">Races</a>  (0 viewing)</p>

                    <p>Share you races, or even find some yourself here!</p>
                  </td>

                  <td align="center">
                                        <pre>
 1 Topics
 1 posts 

</pre>                  </td>

                  <td>February 11, 2010, 2:10 pm<br />
                  <strong>by <a href="Admin">Admin</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=races&amp;id=566&amp;pagenum=last">test</a></td>
                </tr>

                <tr class="mainrow">

                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.gif" alt="My" />                    </div>
                  </td>

                  <td>
                    <p><a href="index.php?page=forum&amp;forum=training">Training</a>  (0 viewing)</p>

                    <p>Share any tips, articles and killer sessions</p>
                  </td>

                  <td align="center">
                                        <pre>
 0 Topics
 0 posts 
</pre>                  </td>

                  <td>January 1, 1970, 12:00 am<br />

                  <strong>by <a href=""></a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=&amp;id=&amp;pagenum=last"></a></td>
                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.gif" alt="My" />                    </div>

                  </td>

                  <td>
                    <p><a href="index.php?page=forum&amp;forum=injuries">Injuries</a>  (0 viewing)</p>

                    <p>Articles on injury prevention and rehabilitation</p>
                  </td>

                  <td align="center">
                                        <pre>
 0 Topics
 0 posts 
</pre>                  </td>

                  <td>January 1, 1970, 12:00 am<br />
                  <strong>by <a href=""></a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=&amp;id=&amp;pagenum=last"></a></td>

                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>
                  </td>

                  <td>

                    <p><a href="index.php?page=forum&amp;forum=QA">Q and A</a>  (0 viewing)</p>

                    <p>Post your questions and someone out there will know the answer</p>
                  </td>

                  <td align="center">
                                        <pre>
 2 Topics
 3 posts 

</pre>                  </td>

                  <td><strong>Today</strong><br />
                  <strong>by <a href="demo">demo</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=QA&amp;id=569&amp;pagenum=last">test2</a></td>
                </tr>
              </table>

            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

  <p>&nbsp;</p>

  <table width="100%" class='loggedin'>

    <tr>
      <td height="55" valign="top">
        <div class="c3"></div>

        <table width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="2" bgcolor="#99B3B4"><strong>Forum Stats!</strong></td>
          </tr>

          <tr>
            <td width="3%"><img src="http://www.runningprofiles.com/images/stats.gif" width="30" height="30" alt="stats" /></td>

            <td width="97%">There are 4 registered users who have posted a total of 8 posts.</td>
          </tr>

          <tr>
            <td valign="top"><img src="http://www.runningprofiles.com/images/CHAT.gif" width="30" height="30" alt="stats" /></td>

            <td><b>There is 1 user currently viewing the forums. </B><A href='Admin'>Admin</a></td>

          </tr>

          <tr>
            <td colspan="2" valign="top" bgcolor="#99B3B4"><strong>Icons</strong></td>
          </tr>

          <tr>
            <td colspan="2" valign="top"><img src="http://www.runningprofiles.com/images/postforum2.jpg" alt="" border="0" />&nbsp;No New Posts<br />
            <img src="http://www.runningprofiles.com/images/postforum2.gif" alt="" border="0" />&nbsp;New Posts</td>

          </tr>
        </table>
      </td>
    </tr>
  </table></body>
</html>

</td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>

        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br />
        <style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
<table width="98%" class="loggedin" >
  <tr>
    <td><table width="100% border="1" > <td bgcolor="#ffffff"> <center> <b><u>Forum</u></b> </center></td>

  <tr bgcolor="#C7D6D6">
  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&forum=QA&id=569&pagenum=last">test2</a></center></td>
  </tr>
  <tr bgcolor="#99b3b4">
  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&forum=General&id=563&pagenum=last">Humour is an act of defiance; that we must laugh at our helplessness against the forces of nature, or go insane.</a></center></td>
  </tr>
  <tr bgcolor="#C7D6D6">

  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&forum=races&id=566&pagenum=last">test</a></center></td>
  </tr>
</table> 
</td>
  </tr>
</table>

<br />


<script language="JavaScript"> <!--
var shout_popup = 0;

function newWindow(url, w, h, x, y, scroll, menu, tool, resizable) {
  if(shout_popup && !shout_popup.closed) shout_popup.close();
  if(!x && !y) {
    x = Math.round((screen.width - w) / 2);
    y = Math.round((screen.height - h) / 2);
  }
  shout_popup = window.open(url, "shout_popup", "width=" + w + ",height=" + h +
                            ",left=" + x + ",top=" + y + ",scrollbars=" + scroll +
                            ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  shout_popup.focus();
}

function refreshBox() {
  document.fShout.sbText.value = "";
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.Refresh.disabled=false", 1000);
}

function shoutIt() {
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.sbText.value=''", 1000);
  setTimeout("document.fShout.Shout.disabled=false", 1000);
}

function login() {
  var pass = prompt("Enter password:", "");
  if(pass) {
    document.fShout.admin.value = pass;
    document.fShout.submit();
  }
  document.fShout.Admin.disabled = false;
}
//--> </script>

<link rel="stylesheet" href="shout/shoutbox.css" type="text/css">
Shout Box
<table border="0" cellspacing="0" cellpadding="0">

<form name="fShout" action="shout/shout.php" target="ShoutBox" method="post">
<input type="hidden" name="sbID" value="f622cdd4d968fdee3103b185195dcb19">
<input type="hidden" name="admin">
<tr valign="top">
    <td><iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"
     width="120" height="300" frameborder="0"></iframe></td>
      </tr><td height="5"></td><tr>
<td>
  <table border="0" cellspacing="0" cellpadding="0" width="120"><tr>
  <td>

    <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>

    </tr></table>
  <textarea name="sbText" rows="3" style="width:120px; height:50px" wrap="virtual" class="cssShoutForm">Insert Text Here</textarea>
    <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
    <td><input type="button" name="Refresh" value="Refresh" class="cssShoutButton" onClick="this.disabled=true; refreshBox()">
      </td>
    <td align="center"><input type="button" name="Shout" value="Shout!" class="cssShoutButton" onclick="this.disabled=true; shoutIt()" /></td>
    
    </tr></table>  </td>

  </tr></table></td>
</tr>
</form>
</table>
</td>
      </tr>
    </table></td>
  </tr>
  
</table>
</body>
</html>

Open in new window

john-formby

You had a few errors:

1.  You need to include <title></title> in your head section
2.  You used <br> instead of <br /> in a couple of places
3.  You used <? instead of <?php for one tag
4.  You missed [space]/ from the end of image and link tags
5.  Missed doctype declaration

Nothing too serious though :-)

John
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
john-formby

I really hope that code you just posted is not one page?
Member_2_5230414

ASKER
Humm but i corrected all that last time and it brought up that function.php error :S

Also yes its both index.php and the included mainfourm.php  alone they are both valid... is it due to the headers ect??? if i just kept the body in mainforum.php and added it to index.php would it be ok then?
john-formby

Ok, there is a lot going on in that page which is going to cause you some serious problems.

You must only ever have one set of HTML, HEAD, TITLE and BODY tags.  You have two sets of each that I can see.  You also have styles and scripts that should be in the HEAD section appearing in the body.

It is difficult for me to work with because I can't check anything when I make changes but give me a few minutes and I will see what I can do :-)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
john-formby

Hi,

I have had a go at validating your code (but I obviously do not know what effect that has had on your layout).  I had to add opening and closing tags as there were quite a lot missing.  I have wrapped everything inside the correct tag structure as well.

There are just two errors remaining which I can't correct.  These are because you are calling the id="posts" three times (Lines: 344, 347, 351).  You can only call an id once in a page.  You will need to change your css to make it a class if you want to use it multiple times.

Hope this helps,

John
<!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>
<title>Running Profiles Forums</title>
<link rel="shortcut icon" href="rp.ico" />
<link rel="icon" type="image/ico" href="rp.ico" />
<link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" />
<link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" />
<link rel="stylesheet" href="shout/shoutbox.css" type="text/css" />
<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
.style1 {color: #000000}
-->
/*<![CDATA[*/
 div.c3 {text-align: left}
 div.c2 {text-align:center;}
 div.c1 {text-align: center}
/*]]>*/
</style> 

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>


<body onload="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">


<table width="100%" bgcolor="#99b3b4" class="sample">
  <tr>
    <td width="10%" height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="80%" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="10%" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
  <tr>
    <td height="85" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>

    <td width="80%" align="center" valign="middle" bgcolor="#99b3b4"><img src="http://www.runningprofiles.com/images/logo.jpg" align="middle" alt="" /></td>
    <td width="10%" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
</table>


<table width="100%" style="height:100%;" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" align="left" valign="top"><table  class="menus" width="100%">

      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0" /></a></p>
          <p><a href="index.php?page=update" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>

          <p><a href="index.php?page=inbox">
Inbox</a> </p>        
</td>
      </tr>
      
      
    </table></td>
    <td width="74%" align="center" valign="top">

<table width="100%" class="loggedin">
                        <tr>
                            <td >

                                <div class="c1">
                                    <div align="center"><em>
                                      <script type='text/javascript'>
                                      <!--
var date=new Date(); // Gets the full date!
var day=date.getHours(); // Gets the hours!

if(day<=11) {
document.write('Good Morning,'); // If it's before 12 PM then display this!
} else if(day<18){
document.write('Good Afternoon,'); // After 12 PM display this!
} else {
document.write('Good Evening,'); // After 6 PM display this!
}
//-->
    </script>
                                    You are logged in as Admin.Your ip address is 86.165.185.208; this is stored for security reasons.</em> </div>
                                </div>                            </td>
                        </tr>
</table>

<br />
  <div class="c1">
    <strong><u>Welcome to the RunningProfiles forum.</u></strong>
  </div>We would like to ask you to please follow the forum's rules to ensure everyone is kept happy. If these are not meet it could lead to a ban. The terms and condition can be found <a href="index.php?page=forumrules">here</a>.

  <table width="99%" class='forum'>
    <tr>
      <td>
        <table width="99%" class='maintable'>

          <tr>
            <td>
              <table class='maintable' width="100%">
                <tr class='headline'>
                  <td>
                    <div class="c1">
                      New posts
                    </div>
                  </td>

                  <td>
                    <div class="c1">
                      Topic
                    </div>
                  </td>

                  <td>Topics/Posts</td>

                  <td width="25%">

                    <div class="c1">
                      Last reply
                    </div>
                  </td>
                </tr>

                <tr class="mainrow">
                  <td width="4%">
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>

                  </td>

                  <td width="68%">
                    <p><a href="index.php?page=forum&amp;forum=General">General</a> 
		 
		(0 viewing)</p>

                    <p>General chit chat about the athletic world!</p>
                  </td>

                  <td width="8%" align="center">
                    
                    <div class="c2">
                      <pre>
5 Topics
 8 posts 
</pre>
                    </div>                  </td>

                  <td colspan="3"><strong>Today</strong><br />
                  <strong>by <a href="runnerjp">runnerjp</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=General&amp;id=563&amp;pagenum=last">Humour is an ac...</a></td>

                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>
                  </td>

                  <td>

                    <p><a href="index.php?page=forum&amp;forum=races">Races</a>  (0 viewing)</p>

                    <p>Share you races, or even find some yourself here!</p>
                  </td>

                  <td align="center">
                                        <pre>
 1 Topics
 1 posts 

</pre>                  </td>

                  <td>February 11, 2010, 2:10 pm<br />
                  <strong>by <a href="Admin">Admin</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=races&amp;id=566&amp;pagenum=last">test</a></td>
                </tr>

                <tr class="mainrow">

                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.gif" alt="My" />                    </div>
                  </td>

                  <td>
                    <p><a href="index.php?page=forum&amp;forum=training">Training</a>  (0 viewing)</p>

                    <p>Share any tips, articles and killer sessions</p>
                  </td>

                  <td align="center">
                                        <pre>
 0 Topics
 0 posts 
</pre>                  </td>

                  <td>January 1, 1970, 12:00 am<br />

                  <strong>by <a href=""></a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=&amp;id=&amp;pagenum=last"></a></td>
                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.gif" alt="My" />                    </div>

                  </td>

                  <td>
                    <p><a href="index.php?page=forum&amp;forum=injuries">Injuries</a>  (0 viewing)</p>

                    <p>Articles on injury prevention and rehabilitation</p>
                  </td>

                  <td align="center">
                                        <pre>
 0 Topics
 0 posts 
</pre>                  </td>

                  <td>January 1, 1970, 12:00 am<br />
                  <strong>by <a href=""></a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=&amp;id=&amp;pagenum=last"></a></td>

                </tr>

                <tr class="mainrow">
                  <td>
                    <div class="c1">
                      <img src="http://www.runningprofiles.com/images/postforum.jpg" alt="My" />                    </div>
                  </td>

                  <td>

                    <p><a href="index.php?page=forum&amp;forum=QA">Q and A</a>  (0 viewing)</p>

                    <p>Post your questions and someone out there will know the answer</p>
                  </td>

                  <td align="center">
                                        <pre>
 2 Topics
 3 posts 

</pre>                  </td>

                  <td><strong>Today</strong><br />
                  <strong>by <a href="demo">demo</a><br /></strong> in <a href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=QA&amp;id=569&amp;pagenum=last">test2</a></td>
                </tr>
              </table>

            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

  <p>&nbsp;</p>

  <table width="100%" class='loggedin'>

    <tr>
      <td height="55" valign="top">
        <div class="c3"></div>

        <table width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="2" bgcolor="#99B3B4"><strong>Forum Stats!</strong></td>
          </tr>

          <tr>
            <td width="3%"><img src="http://www.runningprofiles.com/images/stats.gif" width="30" height="30" alt="stats" /></td>

            <td width="97%">There are 4 registered users who have posted a total of 8 posts.</td>
          </tr>

          <tr>
            <td valign="top"><img src="http://www.runningprofiles.com/images/CHAT.gif" width="30" height="30" alt="stats" /></td>

            <td><b>There is 1 user currently viewing the forums. </b><a href='Admin'>Admin</a></td>

          </tr>

          <tr>
            <td colspan="2" valign="top" bgcolor="#99B3B4"><strong>Icons</strong></td>
          </tr>

          <tr>
            <td colspan="2" valign="top"><img src="http://www.runningprofiles.com/images/postforum2.jpg" alt="" border="0" />&nbsp;No New Posts<br />
            <img src="http://www.runningprofiles.com/images/postforum2.gif" alt="" border="0" />&nbsp;New Posts</td>

          </tr>
        </table>
      </td>
    </tr>
  </table>

</td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>

        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br />
        
<table width="98%" class="loggedin" >
  <tr>
    <td><table width="100%" border="1"><tr> <td bgcolor="#ffffff"> <center> <b><u>Forum</u></b> </center></td>
	</tr>
  <tr bgcolor="#C7D6D6">
  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=QA&amp;id=569&amp;pagenum=last">test2</a></center></td>
  </tr>
  <tr bgcolor="#99b3b4">
  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=General&amp;id=563&amp;pagenum=last">Humour is an act of defiance; that we must laugh at our helplessness against the forces of nature, or go insane.</a></center></td>
  </tr>
  <tr bgcolor="#C7D6D6">

  <td> <center><a id="posts" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=races&amp;id=566&amp;pagenum=last">test</a></center></td>
  </tr>
</table> 
</td>
  </tr>
</table>

<br />


<script type="text/javascript"> <!--
var shout_popup = 0;

function newWindow(url, w, h, x, y, scroll, menu, tool, resizable) {
  if(shout_popup && !shout_popup.closed) shout_popup.close();
  if(!x && !y) {
    x = Math.round((screen.width - w) / 2);
    y = Math.round((screen.height - h) / 2);
  }
  shout_popup = window.open(url, "shout_popup", "width=" + w + ",height=" + h +
                            ",left=" + x + ",top=" + y + ",scrollbars=" + scroll +
                            ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  shout_popup.focus();
}

function refreshBox() {
  document.fShout.sbText.value = "";
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.Refresh.disabled=false", 1000);
}

function shoutIt() {
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.sbText.value=''", 1000);
  setTimeout("document.fShout.Shout.disabled=false", 1000);
}

function login() {
  var pass = prompt("Enter password:", "");
  if(pass) {
    document.fShout.admin.value = pass;
    document.fShout.submit();
  }
  document.fShout.Admin.disabled = false;
}
//--> </script>

Shout Box
<table border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
		<form name="fShout" action="shout/shout.php" target="ShoutBox" method="post">
			<input type="hidden" name="sbID" value="f622cdd4d968fdee3103b185195dcb19" />
			<input type="hidden" name="admin" />
			<table>
			<tr valign="top">
    			<td>
					<iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox" width="120" height="300" frameborder="0"></iframe>
				</td>
      		</tr>
      		<tr>
		  		<td height="5"></td>
			</tr>
			<tr>
				<td>
  					<table border="0" cellspacing="0" cellpadding="0" width="120">
						<tr>
  							<td>
    							<table border="0" cellspacing="0" cellpadding="0" width="100%">
									<tr>
										<td>
										</td>
    								</tr>
								</table>
  								<textarea name="sbText" rows="3" style="width:120px; height:50px" cols="" class="cssShoutForm">Insert Text Here</textarea>
    							<table border="0" cellspacing="0" cellpadding="0" width="100%">
									<tr>
    									<td>
											<input type="button" name="Refresh" value="Refresh" class="cssShoutButton" onclick="this.disabled=true; refreshBox()" />
      									</td>
    									<td align="center">
											<input type="button" name="Shout" value="Shout!" class="cssShoutButton" onclick="this.disabled=true; shoutIt()" />
										</td>
    
    								</tr>
								</table>  
							</td>
  						</tr>
					</table>
				</td>
			</tr>
			</table>
		</form>
		</td>
	</tr>
</table>
</td>
</tr>
</table>
</td>
</tr> 
</table>
</body>
</html>

Open in new window

Member_2_5230414

ASKER
Hye again...ok something is really confusing me...

When i change the include 'header.php'; to the body it chnages my menu tables to they dont go 100% to the bottom... i have no idea why!

below is header.php, i have removed style.php and this does not alter anything so what can it be??
<table width="100%" bgcolor="#99b3b4" class="sample">>
  <tr>
    <td width="10%" height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="80%" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="10%" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
  <tr>
    <td height="85" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
    <td width="80%" align="center" valign="middle" bgcolor="#99b3b4"><img src="http://www.runningprofiles.com/images/logo.jpg" align="middle"/></td>
    <td width="10%" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
</table>

Open in new window

Member_2_5230414

ASKER
Just thought i would add index.php also
<?php
ob_start();
session_start(); 
    require_once '../settings.php';
    checkLogin ('1 2');
 include "../info.php"; // sets username/id ect
          include "../getuser.php"; // records user view on page
include ("../header.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>
<title>Home - RunningProfiles</title>

<link rel="shortcut icon" href="rp.ico" />
<link rel="icon" type="image/ico" href="rp.ico" />
 <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/css/login.css" />
  <link rel="stylesheet" type="text/css" href="http://www.runningprofiles.com/members/include/style.css" />


<style type="text/css">
<!--
body {
    margin-left: 1px;
    margin-top: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
}
-->
</style> 


<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg')">

<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10%" height="100%" align="left" valign="top"><table class="menus" width="100%">
      <tr>
        <td height="100%" align="center" valign="top" bgcolor="#CAD9D9" ><p>Menu</p>
          <p><a href="http://www.runningprofiles.com/members" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)"><img src="http://www.runningprofiles.com/images/home2.jpg" alt="Home" name="home" width="93" height="82" border="0" /></a></p>
          <p><a href="index.php?page=update" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)"><img src="http://www.runningprofiles.com/images/editprofile.jpg" alt="edit profile" name="editprofile" border="0" id="editprofile" /></a></p>
          <p><a href="http://www.runningprofiles.com/logout.php">Logout</a></p>
          <p><?php if($id == 1){ echo '<a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a>'; } ?></p>
          <p><a href="index.php?page=mainforums">Forum</a> </p>
          <p><a href="index.php?page=inbox">
<?php
$user= get_username($_SESSION['user_id']);$query = "SELECT * FROM messages WHERE reciever = '$user' AND recieved = '0';";
$result = mysql_query($query);
$no_of_msgs = mysql_num_rows($result);
if ($no_of_msgs != 0){
  $data = mysql_fetch_assoc($result);
  echo "Inbox($no_of_msgs)";
}
else{
   print "Inbox";
}?></a> </p>   
 <table border="0" height="100%" > 

<tr>
<td>    </td>  
</tr> 
</table>     
</td>
      </tr>
      


      
    </table></td>
    <td width="74%" align="center" valign="top"><?php $page = $_GET['page'];
                    if (ereg('[A-Za-z0-9]',$page) ) {
                        if (file_exists('include/'.$page.'.php')) {
                            include('include/'.$page.'.php');
                        } else {
                            include('include/main.php');
                        }
                   } else {
                            include('include/main.php');
                    }?></td>
    <td width="10%" align="right" valign="top" bgcolor="99b3b4"><table class="menus" width="100%">
      <tr>
        <td align="center" valign="top" bgcolor="#CAD9D9">
        Menu<br />
        <?php include('include/newposts.php');?>
<br />
<?php include('shout/shoutbox.inc.php');?></td>
      </tr>
    </table><table border="0" height="100%" > 

<tr>
<td>    </td>  
</tr> 
</table>    </td>
  </tr>
  
</table>
</body>
</html>

Open in new window

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
john-formby

Hi,

I am working away this week so struggling to get online at the moment :-(

Anyway, your header problem is probably due to a style in one of your stylesheets overwriting it since it only starts happening when you move it inside the body tags.  You will have to check through your stylesheets and see if you can find anything that is affecting it.  Maybe comment out the links to the stylessheets and add them back one at a time to see if it makes any difference.

John
Member_2_5230414

ASKER
Ok im going through the long process of re-wrighting that index page... chopping bits out ect..i will get back to you if i do it lol
john-formby

Hi,

Please feel free to ask questions about anything you are unsure about.  Unfortunately, I think there are a lot of things that could be causing you problems :-(  Without a zip file of all your files and a MySQL dump, it would be impossible to say exactly what is going wrong.

John
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Member_2_5230414

ASKER
Ok john...nealry done it all but this last bits making me go crazy lol spent most day on it and going round and round!


where are the tds and trs supposed to be :S:S
<!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>
        <title>Home - RunningProfiles</title>
  </head>
 
    <body>
<?php
session_start();
include '../info.php';
/*
 +-------------------------------------------------------------------+
 |                      S H O U T B O X   (v3.9)                     |
 |                                                                   |
 | Copyright Gerd Tentler               www.gerd-tentler.de/tools    |
 | Created: Jun. 1, 2004                Last modified: Jun. 14, 2009 |
 +-------------------------------------------------------------------+
 | This program may be used and hosted free of charge by anyone for  |
 | personal purpose as long as this copyright notice remains intact. |
 |                                                                   |
 | Obtain permission before selling the code for this program or     |
 | hosting this software on a commercial website or redistributing   |
 | this software over the Internet or in any other medium. In all    |
 | cases copyright must remain intact.                               |
 +-------------------------------------------------------------------+
*/
  error_reporting(E_WARNING);
 
//========================================================================================================
// Set variables, if they are not registered globally; needs PHP 4.1.0 or higher
//========================================================================================================
 
  if(isset($_SERVER['HTTP_HOST'])) $HTTP_HOST = $_SERVER['HTTP_HOST'];
 
//========================================================================================================
// Includes
//========================================================================================================
 
  if($HTTP_HOST == 'localhost' || $HTTP_HOST == '127.0.0.1' || ereg('^192\.168\.0\.[0-9]+$', $HTTP_HOST)) {
    include('shout/config_local.inc.php');
  }
  else {
    include('shout/config_main.inc.php');
  }
  if(!isset($language)) $language = 'en';
  include("shout/languages/lang_$language.inc");
  include('shout/smilies.inc');
 
//========================================================================================================
// Set session variables (message ID); needs PHP 4.1.0 or higher
//========================================================================================================
 
  if($enableIDs && !$_SESSION['msgID']) {
    srand((double) microtime() * 1000000);
    $_SESSION['msgID'] = md5(uniqid(rand()));
  }
 
//========================================================================================================
// Main
//========================================================================================================
 
  if($boxFolder && !ereg('/$', $boxFolder)) $boxFolder .= '/';
?>
<script type="text/javascript"><!--
var shout_popup = 0;
 
function newWindow(url, w, h, x, y, scroll, menu, tool, resizable) {
  if(shout_popup && !shout_popup.closed) shout_popup.close();
  if(!x && !y) {
    x = Math.round((screen.width - w) / 2);
    y = Math.round((screen.height - h) / 2);
  }
  shout_popup = window.open(url, "shout_popup", "width=" + w + ",height=" + h +
                            ",left=" + x + ",top=" + y + ",scrollbars=" + scroll +
                            ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  shout_popup.focus();
}
 
function refreshBox() {
  document.fShout.sbText.value = "";
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.Refresh.disabled=false", 1000);
}
 
function shoutIt() {
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.sbText.value=''", 1000);
  setTimeout("document.fShout.Shout.disabled=false", 1000);
}
 
function login() {
  var pass = prompt("<?php echo $msg['pass']; ?>", "");
  if(pass) {
    document.fShout.admin.value = pass;
    document.fShout.submit();
  }
  document.fShout.Admin.disabled = false;
}
//--> </script>
 





















	<table border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td>
	<form name="fShout" action="shout/shout.php" target="ShoutBox" method="post">

		<?php echo '<input type="hidden" name="sbID" value="'.$_SESSION['msgID'].'">'; ?>
		<input type="hidden" name="admin">



	<table>
	<tr valign="top">
		<?php
  		$inputsPosition = strtolower($inputsPosition);
  
  		if($inputsPosition == 'left' || $inputsPosition == 'right') {
  		  $txtHeight = round($boxHeight * 0.65);
  			}
  		else $txtHeight = 50;
 
 		 if($inputsPosition == 'right' || $inputsPosition == 'bottom') {
		?>
	<td>
		<?php echo '<iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"width="'.$boxWidth.'" height="'.$boxHeight.'" frameborder="0"></iframe>'; ?>
	</td>
		<?php
   		 if($inputsPosition == 'bottom') {
		?>
	</tr>
	<tr>
	<td height="5">
	</td>
	</tr>

	<tr>
		<?php
   		 }
   		 else {
		?>
     		 <?php
   		 }
 		 }
		?>

 		</tr>
<?php echo '<table border="0" cellspacing="0" cellpadding="0" width="'.$boxWidth.'">'?>
	<tr>
 		 <?php echo '  <textarea name="sbText" rows="3" style="width:'.$boxWidth.'px; height:'.$txtHeight.'px" wrap="virtual" class="cssShoutForm">Insert Text Here</textarea>'; ?>
	</tr>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
	<td>
		<?php echo '<input type="button" name="Refresh" value="'.$msg['refresh'].'" class="cssShoutButton" onClick="this.disabled=true; refreshBox()">'; ?>
	</td>
	<td align="center">
		<?php echo '<input type="button" name="Shout" value="'.$msg['shout'].'" class="cssShoutButton" onclick="this.disabled=true; shoutIt()" />'; ?>
	</td>
	</tr>
		<?php
  		if($inputsPosition == 'left' || $inputsPosition == 'top') {
    		if($inputsPosition == 'top') {
		?>
      
	</table>
	</td>
	</tr>
		<?php
    		}
    		else {
		?>
	<td width="20">&nbsp;</td>
		<?php
   		 }
		?>
	<td>
		<?php echo '
    		<iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"
     		width="'.$boxWidth.'" height="'.$boxHeight.'" frameborder="0"></iframe>'?>
	</td>
		<?php
		  }
		?>
	</tr>

	</table>
	</form>
	</td>
	</tr>
	</table>


</body>
</html>

Open in new window

john-formby

Hi,

I have run this through the validator and have added the relevant td / tr tags.  Please have a look at the code below.  The basic rule you need to follow is that tables have a set structure:

<table>
<tr>
<td>some stuff</td>
</tr>
</table>

You have been doing something like the following in places:

<table>
<tr>
some stuff
</tr>
</table>

With this you are getting errors saying unexpected </tr> tag because it is expecting <td>...</td> tags before closing the row.  You have also had examples where you have missed the <tr> / </tr> tags but included the <td> / </td> tags.  This will give you a similar error.

Hope this helps,

John
<!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>
        <title>Home - RunningProfiles</title>
  </head>
 
    <body>
<?php
session_start();
include '../info.php';
/*
 +-------------------------------------------------------------------+
 |                      S H O U T B O X   (v3.9)                     |
 |                                                                   |
 | Copyright Gerd Tentler               www.gerd-tentler.de/tools    |
 | Created: Jun. 1, 2004                Last modified: Jun. 14, 2009 |
 +-------------------------------------------------------------------+
 | This program may be used and hosted free of charge by anyone for  |
 | personal purpose as long as this copyright notice remains intact. |
 |                                                                   |
 | Obtain permission before selling the code for this program or     |
 | hosting this software on a commercial website or redistributing   |
 | this software over the Internet or in any other medium. In all    |
 | cases copyright must remain intact.                               |
 +-------------------------------------------------------------------+
*/
  error_reporting(E_WARNING);
 
//========================================================================================================
// Set variables, if they are not registered globally; needs PHP 4.1.0 or higher
//========================================================================================================
 
  if(isset($_SERVER['HTTP_HOST'])) $HTTP_HOST = $_SERVER['HTTP_HOST'];
 
//========================================================================================================
// Includes
//========================================================================================================
 
  if($HTTP_HOST == 'localhost' || $HTTP_HOST == '127.0.0.1' || ereg('^192\.168\.0\.[0-9]+$', $HTTP_HOST)) {
    include('shout/config_local.inc.php');
  }
  else {
    include('shout/config_main.inc.php');
  }
  if(!isset($language)) $language = 'en';
  include("shout/languages/lang_$language.inc");
  include('shout/smilies.inc');
 
//========================================================================================================
// Set session variables (message ID); needs PHP 4.1.0 or higher
//========================================================================================================
 
  if($enableIDs && !$_SESSION['msgID']) {
    srand((double) microtime() * 1000000);
    $_SESSION['msgID'] = md5(uniqid(rand()));
  }
 
//========================================================================================================
// Main
//========================================================================================================
 
  if($boxFolder && !ereg('/$', $boxFolder)) $boxFolder .= '/';
?>
<script type="text/javascript"><!--
var shout_popup = 0;
 
function newWindow(url, w, h, x, y, scroll, menu, tool, resizable) {
  if(shout_popup && !shout_popup.closed) shout_popup.close();
  if(!x && !y) {
    x = Math.round((screen.width - w) / 2);
    y = Math.round((screen.height - h) / 2);
  }
  shout_popup = window.open(url, "shout_popup", "width=" + w + ",height=" + h +
                            ",left=" + x + ",top=" + y + ",scrollbars=" + scroll +
                            ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  shout_popup.focus();
}
 
function refreshBox() {
  document.fShout.sbText.value = "";
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.Refresh.disabled=false", 1000);
}
 
function shoutIt() {
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.sbText.value=''", 1000);
  setTimeout("document.fShout.Shout.disabled=false", 1000);
}
 
function login() {
  var pass = prompt("<?php echo $msg['pass']; ?>", "");
  if(pass) {
    document.fShout.admin.value = pass;
    document.fShout.submit();
  }
  document.fShout.Admin.disabled = false;
}
//--> </script>
 





















	<table border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td>
	<form name="fShout" action="shout/shout.php" target="ShoutBox" method="post">

		<?php echo '<input type="hidden" name="sbID" value="'.$_SESSION['msgID'].'">'; ?>
		<input type="hidden" name="admin" />



	<table>
	<tr valign="top">
		<?php
  		$inputsPosition = strtolower($inputsPosition);
  
  		if($inputsPosition == 'left' || $inputsPosition == 'right') {
  		  $txtHeight = round($boxHeight * 0.65);
  			}
  		else $txtHeight = 50;
 
 		 if($inputsPosition == 'right' || $inputsPosition == 'bottom') {
		?>
	<td>
		<?php echo '<iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"width="'.$boxWidth.'" height="'.$boxHeight.'" frameborder="0"></iframe>'; ?>
	</td>
		<?php
   		 if($inputsPosition == 'bottom') {
		?>
	</tr>
	<tr>
	<td height="5">
	</td>
	</tr>

	<tr>
	<td>
		<?php
   		 }
   		 else {
		?>
     		 <?php
   		 }
 		 }
		?>
		</td>
 		</tr>
<?php echo '<table border="0" cellspacing="0" cellpadding="0" width="'.$boxWidth.'">'?>
	<tr>
	<td>
 		 <?php echo '  <textarea name="sbText" rows="3" style="width:'.$boxWidth.'px; height:'.$txtHeight.'px" wrap="virtual" class="cssShoutForm">Insert Text Here</textarea>'; ?>
	</td>
	</tr>
	<tr>
	<td>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
	<td>
		<?php echo '<input type="button" name="Refresh" value="'.$msg['refresh'].'" class="cssShoutButton" onClick="this.disabled=true; refreshBox()">'; ?>
	</td>
	<td align="center">
		<?php echo '<input type="button" name="Shout" value="'.$msg['shout'].'" class="cssShoutButton" onclick="this.disabled=true; shoutIt()" />'; ?>
	</td>
	</tr>
		<?php
  		if($inputsPosition == 'left' || $inputsPosition == 'top') {
    		if($inputsPosition == 'top') {
		?>
      
	</table>
	</td>
	</tr>

		<?php
    		}
    		else {
		?>
		<tr>
	<td width="20">&nbsp;</td>
	</tr>
		<?php
   		 }
		?>
	<tr>
	<td>
		<?php echo '
    		<iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"
     		width="'.$boxWidth.'" height="'.$boxHeight.'" frameborder="0"></iframe>'?>
	</td>
		<?php
		  }
		?>
	</tr>

	</table>
	</form>
	</td>
	</tr>
	</table>


</body>
</html>

Open in new window

Member_2_5230414

ASKER
Hey sorry again...what do these errors mean

Validation Output:  4 Errors

   1. Error Line 222, Column 10: end tag for "body" omitted, but OMITTAG NO was specified

            </tab…

      ¿

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
   2. Info Line 8, Column 4: start tag was here

          <body>

   3. Error Line 222, Column 10: end tag for "html" omitted, but OMITTAG NO was specified

            </tab…

      ¿

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
   4. Info Line 3: start tag was here

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

   5. Error Line 222, Column 9: XML Parsing Error: Premature end of data in tag body line 8

            </table>

      ¿
   6. Error Line 222, Column 9: XML Parsing Error: Premature end of data in tag html line 3

            </table>

on same code above u sent?
Your help has saved me hundreds of hours of internet surfing.
fblack61
john-formby

Can't be exactly the same code as above because that validates :-)

Do you have closing </body> and </html> tags?

Have you closed all of your <tables> before ending the file?
Member_2_5230414

ASKER
aha ok fixed it :)... ok im so confused wiht all this...

Why is it when i validate the code and stick them together i get new validation errors!!


i keep getitng Line 294, Column 7: document type does not allow element "table" here

when I and you have validated it before and it never comes up untill i add it together on one page!!
<!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>
        <title>Home - RunningProfiles</title>

        <link rel = "shortcut icon" href = "rp.ico"/>

        <link rel = "icon" type = "image/ico" href = "rp.ico"/>

        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/css/login.css"/>

        <link rel = "stylesheet" type = "text/css" href = "http://www.runningprofiles.com/members/include/style.css"/>

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

        <style type = "text/css">
        <!--
        body {
            margin-left: 1px;
            margin-top: 1px;
            margin-right: 1px;
            margin-bottom: 1px;
        }
        -->
        </style>

        <script type = "text/javascript">
            <!--


            function MM_swapImgRestore()
                { //v3.0
                var i, x, a = document.MM_sr;

                for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
                    x.src = x.oSrc;
                }

            function MM_preloadImages()
                { //v3.0
                var d = document;

                if (d.images)
                    {
                    if (!d.MM_p)
                        d.MM_p = new Array();

                    var i, j = d.MM_p.length, a = MM_preloadImages.arguments;

                    for (i = 0; i < a.length; i++)
                        if (a[i].indexOf("#") != 0)
                            {
                            d.MM_p[j] = new Image;
                            d.MM_p[j++].src = a[i];
                            }
                    }
                }

            function MM_findObj(n, d)
                { //v4.01
                var p, i, x;

                if (!d)
                    d = document;

                if ((p = n.indexOf("?")) > 0 && parent.frames.length)
                    {
                    d = parent.frames[n.substring(p + 1)].document;
                    n = n.substring(0, p);
                    }

                if (!(x = d[n]) && d.all)
                    x = d.all[n];

                for (i = 0; !x && i < d.forms.length; i++)
                    x = d.forms[i][n];

                for (i = 0; !x && d.layers && i < d.layers.length; i++)
                    x = MM_findObj(n, d.layers[i].document);

                if (!x && d.getElementById)
                    x = d.getElementById(n);

                return x;
                }

            function MM_swapImage()
                { //v3.0
                var i, j = 0, x, a = MM_swapImage.arguments;
                document.MM_sr = new Array;

                for (i = 0; i < (a.length - 2); i += 3)
                    if ((x = MM_findObj(a[i])) != null)
                        {
                        document.MM_sr[j++] = x;

                        if (!x.oSrc)
                            x.oSrc = x.src;

                        x.src = a[i + 2];
                        }
                }
            //-->
        </script>
    </head>

    <body onload = "MM_preloadImages('http://www.runningprofiles.com/images/editprofile2.jpg','http://www.runningprofiles.com/images/home2.jpg'">
        <table width="100%" bgcolor="#99b3b4" class="sample">
  <tr>
    <td width="10%" height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="80%" align="center" valign="middle" bgcolor="#000000"></td>
    <td width="10%" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>
  <tr>

    <td height="85" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
    <td width="80%" align="center" valign="middle" bgcolor="#99b3b4"><img src="http://www.runningprofiles.com/images/logo.jpg" alt="RunningProfiles" align="middle"/></td>
    <td width="10%" align="center" valign="middle" bgcolor="#99b3b4">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
    <td height="1" align="center" valign="middle" bgcolor="#000000"></td>
  </tr>

</table>
 

        <table width = "100%" style = "height: 100%;" cellspacing = "0" border = "0">
            <!-- ============ LEFT COLUMN (MENU) ============== -->
            <tr>
                <td width = "10%" class = "menu" valign = "top" align = "center" bgcolor = "#CAD9D9">
                    <p><a href = "http://www.runningprofiles.com/members" onmouseout = "MM_swapImgRestore()"
                          onmouseover = "MM_swapImage('home','','http://www.runningprofiles.com/images/home.jpg',1)">

                    <img src = "http://www.runningprofiles.com/images/home2.jpg" alt = "Home" name = "home" width = "93"
                         height = "82"                                           border = "0"/></a></p>

                    <p><a href = "index.php?page=update"
                          onmouseout = "MM_swapImgRestore()"
                          onmouseover = "MM_swapImage('editprofile','','http://www.runningprofiles.com/images/editprofile2.jpg',1)">

                    <img src = "http://www.runningprofiles.com/images/editprofile.jpg" alt = "edit profile"
                         name = "editprofile"                                          border = "0"
                         id = "editprofile"/></a></p>

                    <p><a href = "http://www.runningprofiles.com/logout.php">Logout</a></p>

                    <p>
                    <a href="http://www.runningprofiles.com/members/index.php?page=admin">Admin</a></p>

                    <p><a href = "index.php?page=mainforums">Forum</a> </p>

                    <p><a href = "index.php?page=inbox">

                    Inbox</a> </p>
                </td>
                <!-- ============ MIDDLE COLUMN (CONTENT) ============== -->
                <td width = "80%" valign = "top"></td>
                <!-- ============ RIGHT COLUMN (MENU) ============== -->
                <td width = "10%" align = "center" valign = "top" class = "menu" bgcolor = "#CAD9D9">

                    

<table width="98%" class="loggedin" >
  <tr>
    <td>



<table width="100%">
 <tr>
 <td bgcolor="#ffffff">
     <center> <b><u>Forum</u></b> </center>

</td>
</tr>

  
<tr bgcolor="#C7D6D6">
  <td> 
        <center><a class="links" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=QA&amp;id=569&amp;pagenum=last">test2</a></center>
</td>
  </tr>
  
<tr bgcolor="#99b3b4">
  <td> 
        <center><a class="links" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=General&amp;id=563&amp;pagenum=last">Humour is an act of defiance; that we must laugh at our helplessness against the forces of nature, or go insane.</a></center>

</td>
  </tr>
  
<tr bgcolor="#C7D6D6">
  <td> 
        <center><a class="links" href="http://www.runningprofiles.com/members/index.php?page=message&amp;forum=races&amp;id=566&amp;pagenum=last">test</a></center>
</td>
  </tr>
</table> 


</td>
  </tr>
</table>


                    <br/>



<script type="text/javascript"><!--
var shout_popup = 0;
 
function newWindow(url, w, h, x, y, scroll, menu, tool, resizable) {
  if(shout_popup && !shout_popup.closed) shout_popup.close();
  if(!x && !y) {
    x = Math.round((screen.width - w) / 2);
    y = Math.round((screen.height - h) / 2);
  }
  shout_popup = window.open(url, "shout_popup", "width=" + w + ",height=" + h +
                            ",left=" + x + ",top=" + y + ",scrollbars=" + scroll +
                            ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  shout_popup.focus();
}
 
function refreshBox() {
  document.fShout.sbText.value = "";
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.Refresh.disabled=false", 1000);
}
 
function shoutIt() {
  document.fShout.admin.value = "";
  document.fShout.submit();
  setTimeout("document.fShout.sbText.value=''", 1000);
  setTimeout("document.fShout.Shout.disabled=false", 1000);
}
 
function login() {
  var pass = prompt("Enter password:", "");
  if(pass) {
    document.fShout.admin.value = pass;
    document.fShout.submit();
  }
  document.fShout.Admin.disabled = false;
}
//--> </script>
 





















    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <form name="fShout" action="shout/shout.php" target="ShoutBox" method="post">

        <input type="hidden" name="sbID" value="35b98076f0eb7668cc917dd2bf49a732"/>        <input type="hidden" name="admin"/>



    <table>
    <tr valign="top">
            <td>
        <iframe name="ShoutBox" src="shout/shout.php" class="cssShoutBox"width="120" height="300" frameborder="0"></iframe>    </td>

            </tr>
    <tr>
    <td height="5">
    </td>
    </tr>

    <tr>
        
         </tr>
<table border="0" cellspacing="0" cellpadding="0" width="120px">

    <tr>

            <textarea name="sbText" rows="3" style="width:120px; height:50px" wrap="virtual" class="cssShoutForm">Insert Text Here</textarea>    </tr>
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
    <td>
        <input type="button" name="Refresh" value="Refresh" class="cssShoutButton" onClick="this.disabled=true; refreshBox()">    </td>
    <td align="center">
        <input type="button" name="Shout" value="Shout!" class="cssShoutButton" onclick="this.disabled=true; shoutIt()" />    </td>

    </tr>
            </tr>

    </table>
    </form>
    </td>
    </tr>
    </table>
</td>
            <!-- ============ FOOTER SECTION ============== -->

            </tr>

            <tr>
                <td align = "center" height = "20" bgcolor = "#777d6a">
                    Copyright ©
                </td>
            </tr>
        </table>
    </body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
john-formby

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Member_2_5230414

ASKER
Thanks mate - thought bst reward you and open new question rather then keeping this one open :):)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Member_2_5230414

ASKER