So I have the main blog page "viewBlog.php", and a page where you can add entries "add_entry.html".
The information submitted in add_entry should show in viewBlog, however this is not the case as it just stays blank. I dont know why the information submitted in add_entry is not being processed and echoed on the main div for viewBlog.
add_entry.html code:
<html xmlns = "http://www.w3.org/1999/xhtml">
<head> <title> Add Entry </title>
</head>
<body style="background-color:antiquewhite;">
<h1 style="color:red; font-family:arial"> Add an entry to Blog! </h1>
<p>
Instructions: Enter a title and body for your blog entry. In the body, you can use simple HTML formatting elements, such as <b> (bold) and <i> (italic) as well as the hyperlink "anchor" element <a>.
</p>
<form action="viewBlog.php" method="POST">
<table>
<tr>
<td>
Title:
</td>
<td>
<input type="text" name="title" size="61" maxlength="60">
</td>
</tr>
<tr>
<td valign="top">
Body:
</td>
<td>
<textarea name="body" rows="10" cols="80"></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="Submit" value="Add Entry" name="">
<input type="reset" onClick="return confirm('Clear the form?');" value="Clear" name="">
</td>
</tr>
</table>
</form>
viewBlog.php code:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Homepage</title>
<link rel="stylesheet" type="text/css" href="miniCSS.css" title="Style 1" />
</head>
<body>
<div id="wrap">
<div id="header">
<img src="banner.png" alt="banner" height="150px"/>
</div>
<div id="main">
<?php
$title = $_POST["title"];
$body = $_POST["body"];
echo "$title";
echo "$body";
?>
</div>
<div id="sidebar">
<ul>
<li>Home</li>
<li>Add Entry</li>
</ul>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
When you echo variables, don't put quotes around them, that converts them to strings (which are echoed literally as $title and $body). So instead of this
echo "$title";
echo "$body";
write it that way:
echo $title;
echo $body;
Related
So I would like to move up the big title a little bit so i leave space in the main page and css isn't helping i tried many methods like position:absolute , position:relative , position:fixed etc.. still nothing happens
html code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AGENCE DE VOYAGES</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<center>
<body background="ny.jpg" size="100%" width="100%" height="100%" align="center">
<header>
<div class="main">
<div class="logo">
<img src="logo.png">
</div>
<ul>
<li class="active">Accueil</li>
<li>Services</li>
<li>Clients</li>
<li>A Propos</li>
<li>Contact</li>
</ul>
</div>
<div class="title">
<h1 color="white">AGENCE DE VOYAGES</h1>
</div>
<div class="login">
<center>
<form action="auth.php" method="post">
<fieldset style="width:500px;">
<legend align='center'><h1>Connexion</h1></legend>
<table>
<tr>
<td><b>Email: </b></td>
<td><input type="email" name="email"></td>
</tr>
<tr>
<td><b>Mot de passe: </b></td>
<td><input type="password" name="password"></td>
</tr>
</div>
</table>
</fieldset>
</form>
<div class="button">
S'AUTHENTIFIER
S'INSCRIRE
</div>
</center>
</body>
</html>
I have left you an example of what you can do to move your text with css or make it smaller, hope that will solve your problem. I only added to your <h1> tag the class title like so:
<h1 class="title" color="white">AGENCE DE VOYAGES</h1>
.title{
font-size: 20px; /*You can choose here the size of your text*/
float: left; /*Or use right instead of left its up to you*/
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AGENCE DE VOYAGES</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<center>
<body background="ny.jpg" size="100%" width="100%" height="100%" align="center">
<header>
<div class="main">
<div class="logo">
<img src="logo.png">
</div>
<ul>
<li class="active">Accueil</li>
<li>Services</li>
<li>Clients</li>
<li>A Propos</li>
<li>Contact</li>
</ul>
</div>
<div class="title">
<h1 class="title" color="white">AGENCE DE VOYAGES</h1>
</div>
<div class="login">
<center>
<form action="auth.php" method="post">
<fieldset style="width:500px;">
<legend align='center'><h1>Connexion</h1></legend>
<table>
<tr>
<td><b>Email: </b></td>
<td><input type="email" name="email"></td>
</tr>
<tr>
<td><b>Mot de passe: </b></td>
<td><input type="password" name="password"></td>
</tr>
</div>
</table>
</fieldset>
</form>
<div class="button">
S'AUTHENTIFIER
S'INSCRIRE
</div>
</center>
</body>
</html>
I am currently working on a project, but I'm just stuck on something. I know there are a lot of questions related to this, but I couldn't find any useful information.
I'm new to PHP and I need to write php code which changes pages and doesn't change the URL (i.e if I am going to login.php, the URL should still be home.php) and I need to use the GET method.
I'm sorry if there are some mistakes in my code, but thanks for any help.
Here is my home.php file:
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="Layout.css" />
<link rel="stylesheet" type="text/css" href="Menu.css" />
<meta http-equiv="Content-Type" content="text/html"; charset=utf-8" />
<title> Title </title>
</head>
<body>
<div id="Holder"></div>
<div id="Header"></div>
<div id="NavBar">
<nav>
<ul>
<li> Home </li>
<li>Login </li>
<li>Register </li>
</ul>
</nav>
</div>
<div id="Content">
<div id="PageHeading">
<h1> Welcome to HOME page </h1>
</div>
</div>
<div id="Footer"></div>
</body>
</html>
Here is my login.php file:
<?php
session_start();
$db = mysqli_connect ("localhost", "root", "","information1");
if (isset($_POST['Register'])){
$username = mysqli_real_escape_string($db, $_POST['username']);
$password = mysqli_real_escape_string($db, $_POST['password']);
$sql = "SELECT username, password FROM user WHERE username='$username' AND
password='$password'";
$base =mysqli_query ($db, $sql);
if (mysqli_num_rows($base) == 1) {
header ("location: nav_menu.php");
}
else
{
echo "Passwords does not match";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="Layout.css" />
<link rel="stylesheet" type="text/css" href="Menu.css" />
<meta http-equiv="Content-Type" content="text/html"; charset=utf-8" />
<title> Title </title>
</head>
<body>
<div id="Holder"></div>
<div id="Header"></div>
<div id="NavBar">
<nav>
<ul>
<li> Home </li>
<li>Login </li>
<li>Register </li>
</ul>
</nav>
</div>
<div id="Content">
<div id="PageHeading">
<h1> Welcome to HOME page </h1>
</div>
<div id="ContentRight">
<h2> Text2 </h2> </br>
<h6> Text3 </h6 </br>
</div>
<div id="ContentLeft">
<form name ="form2" method="POST" action="login.php">
<div class = "ContentTable">
<table width="400" border="0" align ="left">
<tbody>
<h4> Username: </h4>
<input type="text" name= "username" id="username" required></td>
</tr>
<tr>
<td> </td>
</tr>
<h4> Password: </h4>
<input type="text" name= "password" id="password" required></td>
</tr>
<td><input type="submit" name="Register" id="RegisterButton" value="Register"></td>
</div>
</div>
</form>
<div id="Footer"></div>
</body>
</html>
I'm creating a regitration page which includes php,html and css in bootstrap.Here is my php file.
<?php include "header.php"; ?>
<html>
<head></head>
<body>
<!--content-->
<div class=" container">
<div class=" register">
<h1>Register</h1>
<?php if(isset($_GET[ 'error'])) { echo '<font color="red">'.$_GET[ 'error']. '</font>'; echo '<br><br>'; } if(isset($_GET[ 'ok'])) { echo '<font color="blue">You are successfully Registered..</font>'; echo '<br><br>'; } ?>
<form action="process_register1.php" method="POST">
</div>
<div class="col-md-6 register-bottom-grid">
<h3>Personal infomation</h3>
<div>
<span>Full Name</span>
<input type="text" size="30" maxlength="30" name='fnm'>
</div>
<div>
<span>Username</span>
<input type="text" size="30" maxlength="30" name='unm'>
</div>
<div>
<span>Password</span>
<input type='password' name='pwd' size="30">
</div>
<div>
<span> Confirm password</span>
<input type='password' name='cpwd' size="30">
</div>
<div>
<span> Gender</span>
<input type="radio" value="Female" name="gender" id='f'>Female
<input type="radio" value="Male" name="gender" id='m'>Male
</div>
<div>
<span>E-mail address</span>
<input type='mail' name='mail' size="30">
</div>
<div>
<span> No contact</span>
<input type="text" name='contact' size="30">
</div>
<div>
<span> City</span>
<select style="width: 195px;" name="city">
<option>Tirana</option>
<option>Korca</option>
<option>Vlora</option>
<option>Kavaja</option>
</select>
</div>
<input type="submit" value="submit">
</div>
<div class="clearfix"></div>
</form>
</div>
</div>
</body>
</html>
Here is my header.php file:
<?php session_start(); require( 'config.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Online Shopping</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="New Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
addEventListener("load", function() {
setTimeout(hideURLbar, 0);
}, false);
function hideURLbar() {
window.scrollTo(0, 1);
}
</script>
<!--fonts-->
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
<!--//fonts-->
<!-- start menu -->
<link href="css/memenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/memenu.js"></script>
<script>
$(document).ready(function() {
$(".memenu").memenu();
});
</script>
<script src="js/simpleCart.min.js">
</script>
</head>
<body>
<!--header-->
<div class="header">
<div class="header-top">
<div class="container">
<div class="search">
<form>
<input type="text" value="Search " onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Search';}">
<input type="submit" value="Go">
</form>
</div>
<div class="header-left">
<?php if(isset($_SESSION[ 'status'])) { echo '<ul><li>Logout</li></ul>'; } else { echo '<ul>
<li ><a href="login1.php" >Login</a></li>
<li><a href="register.php" >Register</a></li>
</ul>'; } ?>
<div class="cart box_1">
<a href="checkout.html">
<h3> <div class="total">
<span class="simpleCart_total"></span> (<span id="simpleCart_quantity" class="simpleCart_quantity"></span> items)</div>
<img src="images/cart.png" alt=""/></h3>
</a>
<p>Empty Cart
</p>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="container">
<div class="head-top">
<div class="logo">
<a href="index.html">
<img src="images/logo.png" alt="">
</a>
</div>
<div>
<h1 class="title">Welcome
<?php
if(isset($_SESSION['status']))
{
echo $_SESSION['unm'];
}
else
{
echo 'Book Store';
}
?>
</div>
<div class=" h_menu4">
<ul class="memenu skyblue">
<li class="active grid"><a class="color8" href="index1.php">Home</a></li>
<li><a class="color1" href="#">Categories</a>
<div class="mepanel">
<div class="row">
<?php
$query="select * from category ";
$res=mysqli_query($conn,$query);
while($row=mysqli_fetch_assoc($res))
{
echo' <div class="col1">
<div class="h_nav">
<ul>';
echo '<li>
<a href="subcat.php?cat='.$row['cat_id'].'&catnm='.$row["cat_nm"].'">'.$row["cat_nm"].'
</a>
</li>';
}
echo' </ul>
</div>
</div>';
mysqli_close($conn);
?>
<li><a class="color6" href="contact.html">Contact Us</a></li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
The problem is when I try to open the files from localhost only the header of the page appears so this is the result:
How is it possible that the form doesnt appear?
I assume, that your header.php begins a proper html page with doctype, <html> etc... but after
<?php include "header.php"; ?>
you start your html file again:
<html>
<head></head>
<body>
Make sure your markup is valid!
So it looks like your header file isn't a header, it's a complete HTML document. It opens the document (<html>) and then closes it (</html>). So it makes sense that any HTML you put after including the header won't get rendered - the browser will render the header and assume the document is complete.
Instead you header file should end where the markup for the header ends. Usually this is the opening tag for the container of your content.
Then when you include the header file, it will contain all the markup up to where your content begins, and in your form's file you can put the code for the form and it'll get rendered next.
In your case, try removing the </body> and </html> tags from the header file. That will likely work, though your markup will likely need to be updated to make the design coherent. Also, since those are being created by your header, remove the <html>, <head></head>, and <body> tags from your form's file.
You can also create a footer file that you can include after your form content, and it will close the container and the body and html tags.
Edit
May have scrolled to the end of the first code block when I saw the </body></html>, so you can probably disregard the advice to remove them from the header file - they appear to be there only in my imagination. Removing the opening <html>, <body>, and <head> tags from the from file should do the trick however.
This is my branch.php page and I want to delete and update row when the user click on the edit and delete image in php and directly the row should be deleted or updated in the table.But It is not working neither row is getting updated or deleted.
<?php
$a1=mysql_connect('localhost','root1','oec#123');
$b1=mysql_select_db('rms',$a1);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>branch</title>
<link href="styles/branch.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<header id="top">
<h1>Reporter Management System</h1>
<nav id="mainnav">
<ul>
<li>Home</li>
<li>Branch</li>
<li>Branch Admin</li>
<li>Reporters</li>
<li>Accountant</li>
<li>Settings</li>
<li>Log out</li>
</ul>
</nav>
</header>
<div id="hero">
<img src="News2.jpg" width="1000" height="320" alt=""/> </div>
<form role="form" action ="searchbranch.php" method="post">
<p><label for="Search">Search Branch :</label>
<input class="textbox" type="Search" placeholder="Name" name="Search">
<input type="submit" class="classname" value="Search" >
</form>
<form role= "form" action="createbranch.php" method="post">
<input type="submit" class="classname" value="Add Branch" onClick="href 'createbranch.php' " ></p>
</form>
<section class="page container">
<div>
<div class="span12">
<div class="box pattern ">
<div class="box-header">
<i class="icon-list"></i>
</div>
<table id="sample-table" class="table table-hover table-bordered tablesorter">
<thead>
<tr>
<th>Sl no</th>
<th>Branch</th>
<th>Description</th>
<th>Action</th>
</tr>
<?php
$w='SELECT Sl_no, branch, description from create_branch;';
$recordset=mysql_query($w,$a1) or die(mysql_error());
$totalrows=mysql_num_rows($recordset);
$row_recordset=mysql_fetch_assoc($recordset);
if($totalrows>0)
{
do
{
$r=$row_recordset['Sl_no'];
$d=$row_recordset['branch'];
$d1=$row_recordset['description'];
?>
</thead>
<tbody id='tb-content'>
<tr>
<td><?php echo $r ;?></td>
<td><?php echo $d ;?></td>
<td><?php echo $d1 ;?></td>
<td> <?php echo '
<a href="edit_branch.php?no='.$row_recordset['Sl_no'].'">'?>
<img src="pencil.png" />
<?php '</a>';? > | <?php echo'
<a href="branch_delete.php?no1='.$row_recordset['branch'].'">'?>
<img src="cross.png" /> <?php '</a>';?>
</td>
</tr>
<?php
}while($row_recordset=mysql_fetch_assoc($recordset));
}
mysql_free_result($recordset);
mysql_close($a1);
?>
</tbody>
</table>
</div>
</div>
</div>
</section>
</body>
<footer>
<p> </p><hr>
<center>©Copyright 2015 RepoterManagnmentSystem
</center>
</footer>
</div>
</body>
</html>
This is branch_delete.php
<?php
$cn=mysql_connect('localhost','root1',"oec#123");
$db_selected=mysql_select_db('rms',$cn);
$bn=$_REQUEST['no1'];
$sql='DELETE au.Sl_no,au.name,au.company_name,au.email_id,au.password,au.confirm_password,au.group,au.branch,au.phone,au.wordcount,au.rating,cb.Sl_no,cb.branch,cb.description from admin_user au,create_branch cb where cb.branch="'.$bn.'" AND au.branch=cb.branch ;';
$s1=mysql_query($sql,$cn);
mysql_close($cn);
header('Location: branch.php');
?>
This is update_branch.php
<?php
$a1=mysql_connect('localhost','root1','oec#123');
$b1=mysql_select_db('rms',$a1);
$bn=$_REQUEST['bname'];
$sn=$_REQUEST['Sl_no'];
$d=$_REQUEST['descp'];
$w= 'SELECT branch,description FROM create_branch;';
$recordset=mysql_query($w,$a1) or die(mysql_error());
$totalrows=mysql_num_rows($recordset);
$row_recordset=mysql_fetch_assoc($recordset);
if($totalrows>0)
{
do
{
$r=$row_recordset['branch'];
$s=$row_recordset['description'];
if($bn==$r and $d==$s)
{
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="styles/createbranch.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<header id="top">
<h1>Reporter Management System</h1>
<nav id="mainnav">
<ul>
<li>Home</li>
<li>Branch</li>
<li>Branch Admin</li>
<li>Reporters</li>
<li>Accountant</li>
<li>Settings</li>
<li>Log out</li>
</ul>
</nav>
</header>
<div id="hero">
<img src="News2.jpg" width="1000" height="320" alt=""/>
</div>
<form method="post" action="edit_branch.php">
<article id="main">
<?php echo '<h2>branch already exists</h2>' ; ?>
<h2>Create Branch</h2><hr>
<p><label for="branch name">Branch Name:</label><br><br>
<input class="textbox" type="text" placeholder=" <?php echo $bn ;?>" name="bname"></p><br>
<p><label for="Description">Description:</label><br><br>
<input class="textbox" type="text" placeholder="<?php echo $d ;?>" name="descp"></p><br>
<input type="submit" class="classname" value="Update Branch" ></p> <br>
</article>
</form>
<footer>
<p> </p><hr>
<center> © Copyright 2015 ReporterManagementSystem</center> </footer>
</div>
</body>
</html>
<?php
exit(0);
}
}
while($row_recordset=mysql_fetch_assoc($recordset));
$w1='UPDATE create_branch set branch="'.$bn.'" and description="'.$d.'" where Sl_no="'.$sn.'";';
$x=mysql_query($w1,$a1) or die(mysql_error());
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<div id="wrapper">
<header id="top">
<h1>Reporter Management System</h1>
<nav id="mainnav">
<ul>
<li>Home</li>
<li>Reporters</li>
<li>News Content</li>
<li>Add user</li>
<li>Log Out</li>
</ul>
</nav>
</header>
<img src="News2.jpg" width="1000" height="320" alt=""/>
<?php
echo "<br>";
if($x=="true")
{
header('Location: branch.php');
}
else
{
echo "fail to update branch";
}
echo"<br>";
}
mysql_free_result($recordset);
mysql_close($a1);
?>
The sql query incorrectly built.
To update an SQL query should look like this
UPDATE table_name SET
column1=value1,column2=value2,...
WHERE some_column=some_value;
Your update:
UPDATE create_branch SET
branch="'.$bn.'" ,
description="'.$d.'"
WHERE Sl_no="'.$sn.'"
Sql query - delete:
DELETE FROM table_name
WHERE some_column=some_value;
Your delete:
DELETE FROM create_branch
WHERE cb.branch="'.$bn.'"
Read MySQL documentation about FOREIGN KEY Constraints.
In the case of two tables joined the foreign key, delete or modify a record in the first result will be an appropriate operation on record in the second table.
Example:
MySQL Foreign Key On Delete
Everytime I'm trying to build a jQuery app in my homepage, the app starts to do things on it's own and stops responding my requests.
For instance, I'm trying to implement an image slider and when I run the page, the play/pause button doesn't work and you can see images overlapping over each other. But then when I delete all my PHP includes, it runs normally without any error.
Is this a common error and is there a way to make jQuery accept the existance of includes without loosing control?
<?php
function customPageHeader(){?>
<!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">
<head>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.slider.css" />
<script type="text/javascript" src="javascript/jquery.min.js"></script>
<script type="text/javascript" src="javascript/slider/jquery.slider.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".slider").slideshow({
width : 900,
height : 325,
transition : 'slide'
});
});
</script>
</head>
<body>
<?php }
include_once('header.php');
?>
<div class="content">
<div class="content_01">
<div class="slider2">
<div id="wrapper">
<div class="slider">
<div> <img src="assets/serie_1.jpg" alt=""/> </div>
<div> <img src="assets/serie_2.jpg" alt=""/> </div>
<div> <img src="assets/serie_3.jpg" alt=""/> </div>
<div> <img src="assets/serie_4.jpg" alt=""/> </div>
</div>
</div>
</div>
</div>
</div>
<div style="float:none; clear:both;"></div>
<?php
include_once('footer.php');
?>
</body>
</html>
In my header.php, I have:
<!doctype html>
<html>
<head>
<!-- **************** CSS CALL ************************** -->
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
<!-- ************ JAVASCRIPT CALL *********************** -->
<script type="text/javascript" src="scripts/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="scripts/ablaze_hyper-block.js"></script>
<script type="text/javascript" src="scripts/ablaze_geral.js" charset="utf-8"></script>
<?php if (function_exists('customPageHeader')){
customPageHeader();
}?>
</head>
<body>
<div class="header">
<div class="h_wrapper">
<div class="logo"></div>
<div class="navigation">
<ul class="n_list">
<li class="tab_select01">TEST</li>
<li class="tab_select02">TEST</li>
<li class="tab_select03">TEST</li>
<li class="tab_select04">TEST</li>
</ul>
</div>
<div class="hb_wrapper">
<div class="hyper_block">
<div class="icon fb_icon"><img src="images/hyper_block/fb_icon.png"/></div>
<div class="icon tw_icon"><img src="images/hyper_block/tw_icon.png"/></div>
<div class="icon lg_icon"><img src="images/hyper_block/lg_icon.png"/></div>
<div class="icon nl_icon"><img src="images/hyper_block/nl_icon.png"/></div>
<div class="fb_content"> <img src="images/hyper_block/fb_content.png"/></div>
<div class="tw_content"><img src="images/hyper_block/tw_content.png"/></div>
<div class="lg_content"></div>
<div class="nl_content">
<ul>
<li>TEST</li>
<li><form id="h_nl_form" charset="utf-8" >
<table width="160" border="0" cellspacing="0" cellpadding="0" style="margin-left:3px;">
<tr>
<td><input type="text" id="h_nl_fname" class="h_nl_fname" name="name" maxlength="12" value=" Nome*" onBlur="if(this.value == ''){ this.value = ' Nome*'; this.style.color = '#f38a8a';}" onFocus="if(this.value == ' Nome*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#f38a8a; font-family:verdana;" /></td>
<td><input type="text" id="h_nl_lname" class="h_nl_lname" name="last_name" maxlength="12" value=" Apelido*" onBlur="if(this.value == ''){ this.value = ' Apelido*'; this.style.color = '#f38a8a';}" onFocus="if(this.value == ' Apelido*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#f38a8a; font-family:verdana;" /></td>
</tr>
</table>
<table width="160" border="0" cellspacing="0" cellpadding="0" style="margin-left:3px;">
<tr>
<td width="132"><input type="text" id="h_nl_email" class="h_nl_email" name="email" maxlength="40" value=" Email*" onBlur="if(this.value == ''){ this.value = ' Email*'; this.style.color = '#f38a8a';}" onFocus="if(this.value == ' Email*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#f38a8a; font-family:verdana;" /></td>
<td><input type="button" class="h_btn" value=">"/></td>
</tr>
</table></form><div class="h_error_display"></div>
<div class="h_success_display"></div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div style="float:none; clear:both;"></div>
</body>
</html>
In my footer.php, I have:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script type="text/javascript" src="scripts/ablaze_geral.js" charset="utf-8"></script>
<?php if (function_exists('customPageHeader')){
customPageHeader();
}?>
</head>
<body>
<div style="float:none; clear:both;"></div>
<div class="footer">
<div class="f_bar_top"></div>
<div class="f_wrapper">
<ul>
<li><a href="index.php" ><img src="images/logo.png"/></a><br/>
<h1 class="h_footer">CONTACTE-NOS</h1>
<br/>
<table width="220" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35"><img src="images/contactos/f_email_icon.png"></td>
<td><h3 class="h_footer"><p>#</p></h3></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="35"><img src="images/contactos/f_telf_icon.png"></td>
<td><h3 class="h_footer">+351 91 000 00 00</h3></td>
</tr>
</table>
<br/>
</li>
<li><br/>
<p><h1 class="h_footer">LINKS POPULARES</h1></p>
<h3 class="h_footer"><p>INÍCIO</p>
<p>SERVIÇOS</p>
<p>PORTEFÓLIO</p>
<p>QUEM SOMOS</p>
<p>CONTACTO</p></h3>
</li>
<li><br/><h1 class="h_footer">ACOMPANHE-NOS</h1>
<table width="220" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:8px;">
<tr>
<td width="35" height="30"><img src="images/contactos/f_facebook.png"></td>
<td>#</td>
</tr>
<tr>
<td width="35"><img src="images/contactos/f_twiter.png"></td>
<td>#</td>
</tr>
</table><h2 class="h_footer">NEWSLETTER</h1>
<form id="nl_form" charset="utf-8" >
<table width="220" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="112"><input type="text" id="f_nl_fname" class="f_nl_fname" name="name" maxlength="12" value=" Nome*" onBlur="if(this.value == ''){ this.value = ' Nome*'; this.style.color = '#60695d';}" onFocus="if(this.value == ' Nome*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#60695d; font-family:verdana;" /></td>
<td><input type="text" id="f_nl_lname" class="f_nl_lname" name="last_name" maxlength="12" value=" Apelido*" onBlur="if(this.value == ''){ this.value = ' Apelido*'; this.style.color = '#60695d';}" onFocus="if(this.value == ' Apelido*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#60695d; font-family:verdana;" /></td>
</tr>
</table>
<table width="220" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="184"><input type="text" id="f_nl_email" class="f_nl_email" name="email" maxlength="40" value=" Email*" onBlur="if(this.value == ''){ this.value = ' Email*'; this.style.color = '#60695d';}" onFocus="if(this.value == ' Email*'){ this.value = ''; this.style.color = '#f2f2f2';}" style="color:#60695d; font-family:verdana;" /></td>
<td><input type="button" class="f_btn" value=">>"></td>
</tr>
</table>
</form>
<div class="f_error_display"></div>
<div class="f_success_display"></div>
</li>
<li class="f_last"></li>
</ul>
</div>
<div class="f_bar_bottom"><div style="float:none; clear:both;"></div></div>
</div>
</body>
</html>
SOLUTION:
Got the solution by removing all the <html>, <head>, <body> declarations from header.php and footer.php, leaving only the <div> tags.
Since this solved your issue. I am posting my comment as a solution.
Do you notice the multiple doctype, html, head, body declarations? For fragments such as custom headers and footers you should do away with these declarations because the fragments are not supposed to be full html pages.
Additional stuff:
Even after removing these root level elements make sure your HTML is valid. Not in your case but usually header includes are placed inside the html->head. So 'divs', 'tables' and other such elements would break the html if placed inside the head. To avoid similar issues be careful about what goes in the head and body sections.
SOLUTION: Got the solution by removing all the html, head, body declarations from the header.php and footer.php leaving only the div tags.