dompdf render doesn't look like html - php

i use dompdf with codeigniter to convert my php (html) file into pdf.
My problem is the dompdf render doesn't appear like my php page :
Style for php file :
body {font-family:Arial, Helvetica, sans-serif;
font-size:15px;
color:#000;}
.xls {
border-top:1px solid #868686; }
.xls tr > td {
border-right:1px solid #868686; padding: 2px 3px 2px 5px;}
.t-pad tr > td {
border-right:1px solid #868686; padding: 2px 3px 2px 5px;}
.xls tr:first-child >td {
border-top:1px solid #868686;border-bottom:1px solid #000;}
.xls tr:last-child >td {
border-bottom:1px solid #868686;
text-align: center;
}
.xls {
border-right:1px solid #868686;
border-left:1px solid #868686;
}
.xls .m-td{
border-bottom: 0 none !important;
border-left: 1px solid #868686;
border-right: 1px solid #868686;
border-top: 0 none !important;}
.last-col{border-right:0 !important;
border-top: 0 none !important; }
.td-tab{ padding:10px 10px 10px 20px !important;}
.tab-center{ border-left: 1px solid #868686; }
.tab-center td{ padding: 0 0 0 5px; border-bottom: 1px solid #868686; }
.first-td {
border-top: 1px solid #868686 !important;
}
.border-r{border-right: 1px solid #868686 !important;}
.tab-cc{
border: 1px solid #868686;
}
.border-bt{border-bottom: 1px solid #868686 !important;}
.titre-tab {
background:#b2b1b1;
}
and it appear like :
http://info-du-jour.net/wp-content/uploads/2014/06/php.png
fil in controller to convert into pdf :
$data = $this->data_paie($ids);
$this->load->view('paie/fdp_etat', $data);
// Get output html
$html = $this->output->get_output();
// Load library
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->load_html($html);
$this->dompdf->render();
$this->dompdf->stream("fiche_de_paie.pdf",array('Attachment'=>0));
and it look like
http://info-du-jour.net/wp-content/uploads/2014/06/dompdf.png
html rendering code :
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="50" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="font-size:24px; font-weight:bold;">BULLETIN DE PAIE</td>
<td align="right">
<img src="/logo/logo_simple1.jpg"
width="136" height="31" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" width="101"><strong>Période :</strong></td>
<td width="197" colspan="3" align="center">
<div style="font-size:14px; font-weight:bold;">
01-06-2014 au 30-06-2014 </div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="48%" valign="top">
<table border="0" cellpadding="0" cellspacing="2" class="tab-cc t-pad" width="100%" style="height:150px;">
<tr>
<td width="137"><strong>Matricule</strong></td>
<td width="217">SAL003</td>
</tr>
<tr>
<td><b>Nom et Prénom</b></td>
<td>AYARI Marwa</td>
</tr>
<tr>
<td><strong>Fonction</strong></td>
<td>Développeur</td>
</tr>
<tr>
<td><strong>Sit. familiale</strong></td>
<td>Marié </td>
</tr>
<tr>
<td><strong>Nbre d'enfants</strong></td>
<td>3</td>
</tr>
</table></td>
<td width="4%"> </td>
<td width="48%" align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="2" class="tab-cc" style="height:150px;">
<tr>
<td align="center"><b>EMPLOYEUR</b></td>
</tr>
<tr>
<td align="center"><strong>TOPO+</strong><br />
6 Rue des Cyclamens<br />
1004 EL MENZAH 5, ARIANA.<br />
CNSS Employeur : 45454 </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table border="1" cellspacing="2" cellpadding="0" class="tab-cc xls" width="48%" >
<tr>
<td rowspan="2"><b>Droit congés payés</b></td>
<td align="center">Ancien solde</td>
<td align="center">(+) Droits</td>
<td align="center">(-) Pris</td>
<td align="center">Nouv. solde</td>
</tr>
<tr>
<td align="center">12</td>
<td align="center">1</td>
<td align="center">5</td>
<td align="center">2</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="100%" border="1" cellpadding="0" cellspacing="2" class="xls">
<tr class="titre-tab">
<td height="40"><strong>Désignation</strong></td>
<td><strong>Nombre</strong></td>
<td><strong>Base</strong></td>
<td><strong>Gains</strong></td>
<td><strong>Retenues</strong></td>
</tr>
<tr>
<td>Nombre de jours de présence</td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right">26</td>
<td align="right"> </td>
</tr>
<tr>
<td>Salaire de base</td>
<td align="right"> </td>
<td align="right">1258,799</td>
<td align="right">1258,799</td>
<td align="right"> </td>
</tr>
<!-- autant de lignes que de primes dans la conv collective -->
<tr>
<td>Indemnité de transport</td>
<td align="right"> </td>
<td align="right">40,000</td>
<td align="right">40,000</td>
<td align="right"> </td>
</tr>
<tr>
<td>Prime de présence</td>
<td align="right"> </td>
<td align="right">2,080</td>
<td align="right">2,080</td>
<td align="right"> </td>
</tr>
<tr>
<td>Indemnité de déplacement</td>
<td align="right"> </td>
<td align="right">0,000</td>
<td align="right">0,000</td>
<td align="right"> </td>
</tr>
<tr>
<td> <b>Total Brut</b></td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right">1300,879</td>
<td align="right"> </td>
</tr>
<tr>
<td>Retenu C.N.S.S</td>
<td align="right"> </td>
<td align="right">1300,879</td>
<td align="right"> </td>
<td align="right">119,421</td>
</tr>
<tr>
<td><b>SALAIRE IMPOSABLE</b></td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right">1181,458</td>
</tr>
<tr>
<td>IRPP</td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right">173,646</td>
</tr>
<tr>
<td> <b>Total Cotisations</b></td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right">293,067</td>
</tr>
<tr height="35">
<td> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table cellpadding="0" cellspacing="2" border="0" width="100%">
<tbody>
<tr height="21">
<td align="right"> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="21">
<td width="66%" align="right"><strong>Net à Payer</strong></td>
<td width="3%"></td>
<td width="2%"></td>
<td width="29%" colspan="2" align="right" class="tab-cc"><span style="font-weight:bold;padding-right: 4px;">1007,812</span> </td>
</tr>
<tr height="21">
<td align="right"> </td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table>

Instead of using $html = $this->output->get_output(); you can get the same HTML as it is rendering on browser . for that you need to make changes in script like :
$html = $this->load->view('paie/fdp_etat', $data , true); // so now your `$html` will be string which will return string from your view and both will be same.
For reference SEE HERE

Related

In php I'm able to download excel file, but when I use same code in codeigniter it's directly sending HTML content instead of downloading XLS file?

<?php
$data1 ='<div id="prnittab">
<table width="100%" style="font-size:13px; margin-top:11px;border:solid 1px #333333;border-
bottom: 0px;">
<tr>
<td width="100%" style="padding:20px;">
<table width="100%" style="border:0px;">
<tr>
<td width=20% height="5px;" colspan="2"><img src="https://www.fillmurray.com/640/360"
width="220" height="75" alt="logo" /></td>
</tr>
<tr>
<td colspan="2" height="10"></td>
</tr>
<tr>
<td width="50%" align="left" valign="top style="font-size:16px;font-weight:bold;padding-left:15px;">Report Data</td>
<td width="50%" align="right" valign="top"
style="font-size:12px;font-weight:bold;padding-right:15px;">Monday, September 23, 2019</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" style="border-collapse: collapse;border: 1px solid #333333;">
<tr height="30">
<td align="left" style="font-size:12px;font-size:12px;font-weight:bold;padding-left:10px;">XYZ</td>
<td align="left"
style="font-size:12px;font-size:12px;font-weight:bold;height:20px !important;padding-right:10px;">Check
</td>
<td align="right"
style="font-size:12px;font-size:12px;font-weight:bold;height:20px !important;padding-right:10px;">
$540.00</td>
</tr>
</table>
</div>';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file");
echo $data1;

php foreach loop repeat td's 2 times in a tr

I creating a PDF for print the address of users. I have the below HTML structure:
I have tried with the below code:
<?php $i=0; ?>
<tr valign="top">
foreach ($users as $user): ?>
<?php if ($i % 2 == 1) {?>
<tr valign="top">
<?php } ?>
But it's now work as expect.
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="48%" align="left" valign="top" style="padding:10px 10px 15px; font-size:14px; color:#333; font-family:Verdana, Geneva, sans-serif; border:1px solid #ccc;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%" height="25" valign="bottom">Name</td>
<td width="78%" valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom"> </td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom">Phone</td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
</table></td>
<td width="4%" align="left"> </td>
<td width="48%" align="left" style="padding:10px 10px 15px; font-size:14px; color:#333; font-family:Verdana, Geneva, sans-serif; border:1px solid #ccc;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%" height="25" valign="bottom">Name</td>
<td width="78%" valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom"> </td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom">Phone</td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
</table></td>
</tr>
<tr valign="top">
<td height="15" align="left"></td>
<td height="15" align="left"></td>
<td height="15" align="left"></td>
</tr>
</table>
In the abolve table I want to repeat the TD in each TR 2 times and added the blank TR after every TR.
The above HTML out should be the below image:
Could any one can help me out this.
If I get properly what you're looking for : I want to repeat in one TR repeat two TD
Then this code:
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
echo"<table>";
for ($i = 1; $i <= 10; $i++) {
if(($i % 2) == 1) // odd -> start TR
{ echo "<tr><td class=\"dark\">$i</td>"; }
else // even -> close TR
{ echo "<td class=\"red\">$i</td></tr><tr><td colspan=\"2\">whatever here</tr>"; }
}
echo"</table>";
?>
will give you this output :
<table>
<tr><td class="dark">1</td><td class="red">2</td></tr><tr><td colspan="2">whatever here</tr>
<tr><td class="dark">3</td><td class="red">4</td></tr><tr><td colspan="2">whatever here</tr>
<tr><td class="dark">5</td><td class="red">6</td></tr><tr><td colspan="2">whatever here</tr>
<tr><td class="dark">7</td><td class="red">8</td></tr><tr><td colspan="2">whatever here</tr>
<tr><td class="dark">9</td><td class="red">10</td></tr><tr><td colspan="2">whatever here</tr>
</table>
EDIT after you comment : added one 'blank' TR
Try below solution you missed out to close
<?php
$i=0;
foreach ($users as $user){
if ($i % 2 == 0) {?>
<tr valign="top">
<?php } ?>
<td width="48%" align="left" style="padding:10px 10px 15px; font-size:14px; color:#333; font-family:Verdana, Geneva, sans-serif; border:1px solid #ccc;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%" height="25" valign="bottom">Name</td>
<td width="78%" valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom"> </td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
<tr>
<td height="40" valign="bottom">Phone</td>
<td valign="bottom" style="border-bottom:1px dashed #ccc;"> </td>
</tr>
</table></td>
<?php if ($i % 2 == 0) {?>
</tr>
<?php } }?>

Cannot Modify Header Iformation

I am getting this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/renta142/public_html/includes/connection_prop.php:14) in /home/renta142/public_html/login.php on line 31
My PHP Code is:
<?php
session_start();
if($_SESSION['user']['id']!=""){
header("location:index.php");
exit();
}
$login_email=$_POST[email];
$username=$_POST[username1];
$name=$_POST[name];
$er=$_POST[er];
if(trim($_POST["SignIn"])=="Sign In"){
include("includes/connection_user.php");
$user_=$_POST["username"];
$pass=$_POST["pass"];
$query=mysql_query("select * from user_registration where UserID='".$user_."' and Password='".$pass."' and Display='1'");
$result=mysql_fetch_array($query);
if(!strcmp($result[Password],$pass)){
$_SESSION['user']['id'] = $result[AID];
$_SESSION['user']['password'] = $result[Password];
$_SESSION['user']['username'] = $result[UserID];
$_SESSION['user']['name']=$result[Name];
$ref=$_SESSION["refer_url"];
if($_REQUEST['ref']=="sell"){
header("Location:postproperty_sell.php");
exit();
}
else if($ref==""){
header("Location:postproperty.php");
exit();
}
else{
header("Location:$ref");
exit();
}
}else{
$errsg="Invalid Username and Password !";
}
mysql_close();
}
include("config.php");
$sitename=ucfirst($thirdsite)." - Property in ".ucfirst($addresscity);
$keys="property in ".ucfirst($addresscity);
$desc="Real estate agents offers - property in ".ucfirst($addresscity);
include("includes/header.php");
include("includes/left.php");
?>
<script language='javascript' src="images/script.js"></script>
<script type="text/javascript">
function popUp_file(URL){
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=900,height=600');");
}
<?php if($_REQUEST[fcode]=='wrong'){?>
window.onload=function(){document.getElementById('fpass').style.display='block';}
<?php }?>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<td valign="top" align="center" colspan="2">
<table width="794" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="green"> </td>
<td> </td>
</tr>
<tr>
<td align="left" valign="middle" class="green"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"><img src="images/customer_login.gif" alt="CUSTOMER LOGIN" width="24" height="23" /></td>
<td width="92%">PROPERTY OWNER LOGIN </td>
</tr>
</table></td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/mbenifites.gif" alt="MEMBERSHIP BENEFITS" width="16" height="17" /></td>
<td width="92%"> FREE MEMBERSHIP BENEFITS</td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<tr>
<td width="50%" valign="top"><?php if($errsg){ echo "<br /><div class='alert' align='center'>".$errsg."</div><br />"; } ?>
<table width="100%" cellpadding="4" cellspacing="1" class="heading" valign="top">
<form action="login.php?ref=<?php echo $_REQUEST['ref']; ?>" method="post" name="signin" id="signin" onsubmit="return loginform();">
<tr>
<td class="txt">Username<font color="red">*</font></td>
<td width="1" align="left"><strong>:</strong></td>
<td align="left"><input name="username" type="text" id="username" onfocus="if(this.value=='Username') this.value='';" onblur="if(this.value=='') this.value='Username';" value="Username" /></td>
</tr>
<tr>
<td class="txt">Password<font color="red">*</font></td>
<td align="left"><strong>:</strong></td>
<td align="left"><input type="password" name="pass" onfocus="if(this.value=='**********') this.value='';" onblur="if(this.value=='') this.value='**********'" value="**********" /></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td align="left"><input type="submit" name="SignIn" value="Sign In" class="button" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"> <img src="images/nuser.gif" alt="New User registration" width="19" height="21" alt="" /> New User ?</font><a href="login.php#reg"><font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Register First</font><br />
</a> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Forgot Password </font></td>
</tr>
</form>
</table></td>
<td width="50%" valign="top" style="background:url(images/login_page.jpg) no-repeat right; height:200px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="11%" align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td width="89%" valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Advertise your properties for Sale/Rent/PG </font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get Special offers and freebies</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get updates on our new products</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Response through mail, phone</font></td>
</tr>
</table> </td>
</tr>
</table></td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="<?php echo $thirdsite ?>is commited your information is strictly confidential, unless you want to expose it." width="19" height="18" /> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><font color="#666666" size="2" face="Arial, Helvetica, sans-serif"> <?php echo ucfirst($thirdsite); ?> is commited your information is strictly confidential, unless you want to expose it.</font></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<a name="fp"></a>
<div id="fpass" style="display:none;">
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><span class="green"><img src="images/forget_pass.gif" alt="FORGOT PASSWORD" width="20" height="19" /></span></td>
<td width="97%"><span class="green"> FORGOT PASSWORD</span></td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" align="right" cellpadding="2" cellspacing="0">
<form action="forget_password_submit.php" method="post" name="forget_password" id="forget_password">
<input type="hidden" name="chk" value="2" />
<?php if($_GET[fcode]) echo ' <tr>
<td class="alert" align="center" colspan="3">Your EmailID or UserName Is Not Found In Our Database, Please Try Again!!!</td></tr>';?>
<tr >
<td width="20%" align="right" valign="top" class="txt"> Username</td>
<td width="2%" valign="top"><b>:</b></td>
<td width="78%" align="left" valign="top"><input type="text" name="username1" /></td>
</tr>
<tr>
<td colspan="2" align="right" class="heading"> OR</td>
<td class="heading" align="left"> </td>
</tr>
<tr>
<td align="right" valign="top" class="txt"> Email-ID</td>
<td valign="top"><b>:</b></td>
<td align="left" valign="top"><input type="text" name="email1" /></td>
</tr>
<tr>
<td colspan="3" align="right" height="8"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="center"> </td>
<td align="left"><input name="submit" type="submit" onclick="return ForgetpassForm();" value="Submit" class="button" /></td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><img src="images/login.gif" alt="Existin user login" width="19" height="21" /></font> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Login</strong></font></td>
</tr>
<tr>
<td align="right" colspan="4" height="8"></td>
</tr>
<tr>
<td colspan="3" align="right"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail." width="19" height="18" /></font></strong><strong><font size="2" face="Arial, Helvetica, sans-serif"> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><span class="text"> Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail. </span></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" align="center" height="7"></td>
</tr>
</form>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php //if($errsg=="Invalid Username and Password !"){?>
<a name="reg"></a>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="heading"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><img src="images/if_you_do.gif" alt="If you do not have an existing Customer Account with us fill in the form below" width="19" height="19" /></td>
<td width="97%"> If you do not have an existing User Account with us fill in the form below. </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/NEW-USER-REGISTER-FORM.gif" alt="NEW USER REGISTER FORM " width="26" height="27" /></td>
<td width="97%"> NEW USER REGISTER FORM </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><form name="register" method="POST" action="registration_submit.php?ref=<?php echo $_REQUEST['ref']; ?>" onsubmit="return registerForm();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top" style="border:#CCCCCC 1px solid;">
<table width="100%" cellpadding="4" cellspacing="0">
<tr>
<td bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">User Login Information</font></td>
<td bgcolor="#EEEEEE"> </td>
<td align="right" bgcolor="#EEEEEE"><span class="alert">* Mandatory Fields</span></td>
</tr>
<tr>
<td width="39%" class="tdspace txt"><font color="red">*</font>Username</td>
<td width="3%">:</td>
<td width="58%"><input name="username" type="text" id="username" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Password</td>
<td>:</td>
<td><input type="password" name="password" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Confirm Password</td>
<td>:</td>
<td><input type="password" name="rpassword" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Email-ID</td>
<td>:</td>
<td><input type="text" name="email" size="25" /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">Contact Information</font></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Name</td>
<td>:</td>
<td><input type="text" name="name" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Verification Code</td>
<td>:</td>
<td><input name="verify_code" type="text" size="15" />
<img src="verificationimage.php" alt="verification image, type it in the box" width="60" height="30" align="absbottom"/></td>
</tr>
<tr>
<td colspan="3" class="text"><input type="checkbox" name="term" />
I have read <font color="red">Terms and Conditions</font> and I accept these conditions.</td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="left"><input name="submit2" type="submit" value="Submit" class="button" />
<input name="reset" type="reset" value="Reset" class="button" />
<input name="flg" type="hidden" id="flg" value="1" /></td>
</tr>
</table></td>
<td width="1%" > </td>
<td width="49%" valign="top"><img src="images/register.jpg" alt="For Free registration on <?php echo ucfirst($thirdsite); ?>, Advertise your properties for Sale/Rent/PG, Get Special offers and freebies, Get updates on our new products, Response through mail, phone" width="380" height="380" /></td>
</tr>
</table>
</form></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<?php //}?>
</td>
<script language='javascript'>signin.username.focus();</script>
<?php
//include("includes/right.php");
include("includes/footer.php");
?>
public_html/includes/connection_prop.php:14 is probably outputting some blank spaces. Check that file and other includes for whitespace around tags.
You cannot send headers if any text has already been output

How can I cleanly print a web page to a Generic/Txt Printer?

I have an web application that generates a small receipt format.
when printed to a generic/txt printer.. Nothing is printed to the sheet
Here is a sample of the print..
Removed
Please is there a way i could print this webpage to a generic/txt printer
Here is the html
<style>
body{
font-family:"Courier New", Courier, monospace;
font-size:13px;
}
.f1{
text-transform:uppercase;
display:block;
text-align:center;
}
.f2{
text-transform:uppercase;
display:block;
margin-left:10px;
}
.border_bottom{
border-bottom:2px dashed #000;
}
.border_top{
border-top:2px dashed #000;
}
.body_table{
border:1px dashed #CCCCCC;
padding:.5em;
}
</style>
</head>
<body onload="window.print();">
<table width="300" cellpadding="0" cellspacing="0" class="body_table">
<tr>
<td><span class="f1">Official Receipt</span></td>
</tr>
<tr>
<td><span class="f1">DreamWorks Pharmaceutical Industries Limited GH.</span></td>
</tr>
<tr>
<td><span class="f1">Plot 14 Blk 8A</span></td>
</tr>
<tr>
<td class="border_bottom"><span class="f1">0241093621</span></td>
</tr>
<tr>
<td class=""><span class="f2">RECEIPT NO.: 0241093621</span></td>
</tr>
<tr>
<td class=""><span class="f2">VAT REG #.: </span></td>
</tr>
<tr>
<td class=""><span class="f2">cashier.: </span></td>
</tr>
<tr>
<td class=""><span class="f2">date.: time: </span></td>
</tr>
<tr>
<td class="border_bottom"><span class="f2">customer.: time: </span></td>
</tr>
<tr>
<td>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"><span class="f2">QTY</span></td>
<td width="60%"><span class="f2">item</span></td>
<td width="15"><span class="f2">price</span></td>
<td width="15"><span class="f2">amt.</span></td>
</tr>
<tr>
<td class="f2">52</td>
<td>MALAREX TABS</td>
<td>2.6</td>
<td>135.20</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="border_top border_bottom">
<table width="100%" cellpadding="0" cellspacing="0" align="left" id="print_table7">
<tr>
<Td class="ash_backg" width="53%"><span>Subtotal</span></Td>
<td width="47%" align="right">135.20</td>
</tr>
<tr>
<Td class="ash_backg"><span>Discount</span></Td>
<td align="right">0.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>VAT</span></Td>
<td align="right">0.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>Total Due</span></Td>
<td align="right">135.20</td>
</tr>
<tr>
<Td class="ash_backg"><span>Paid</span></Td>
<td align="right">135.20</td>
</tr>
<tr>
<Td class="ash_backg"><span>Change</span></Td>
<td align="right">0.00</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Thank You dear customer</td>
</tr>
<tr>
<td>VAT Inclusive Where Applicable</td>
</tr>
</table>
</body>
Here's the Receipt Format HTML
<!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>
<meta http-equiv="Content-Type" content="text/plain; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#media screen{
body{
font-family:"Courier New", Courier, monospace;
font-size:13px;
}
.f1{
text-transform:uppercase;
display:block;
text-align:center;
}
.f2{
text-transform:uppercase;
display:block;
margin-left:10px;
}
.border_bottom{
border-bottom:2px dashed #000;
}
.border_top{
border-top:2px dashed #000;
}
.body_table{
border:1px dashed #CCCCCC;
padding:.5em;
}
}
#media print{
body{
font-family:"Courier New", Courier, monospace;
font-size:8px;
width:250px;
}
}
</style>
</head>
<body onload="window.print();">
<table width="300" cellpadding="0" cellspacing="0" class="body_table">
<tr>
<td><span class="f1">Official Receipt</span></td>
</tr>
<tr>
<td><span class="f1">DreamWorks Pharmaceutical Industries Limited GH.</span></td>
</tr>
<tr>
<td><span class="f1">Plot 14 Blk 8A</span></td>
</tr>
<tr>
<td class="border_bottom"><span class="f1">0241093621</span></td>
</tr>
<tr>
<td class=""><span class="f2">RECEIPT NO.: 0241093621</span></td>
</tr>
<tr>
<td class=""><span class="f2">VAT REG #.: </span></td>
</tr>
<tr>
<td class=""><span class="f2">cashier.: </span></td>
</tr>
<tr>
<td class=""><span class="f2">date.: time: </span></td>
</tr>
<tr>
<td class="border_bottom"><span class="f2">customer.: time: </span></td>
</tr>
<tr>
<td>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"><span class="f2">QTY</span></td>
<td width="60%"><span class="f2">item</span></td>
<td width="15"><span class="f2">price</span></td>
<td width="15"><span class="f2">amt.</span></td>
</tr>
<tr>
<td class="f2">6</td>
<td>MALAREX TABS</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td class="f2">1</td>
<td>PARAFEN PLUS TAB.</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td class="f2">5</td>
<td>ASTHAX INHALER</td>
<td>5</td>
<td>25</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="border_top border_bottom">
<table width="100%" cellpadding="0" cellspacing="0" align="left" id="print_table7">
<tr>
<Td class="ash_backg" width="53%"><span>Subtotal</span></Td>
<td width="47%" align="right">25.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>Discount</span></Td>
<td align="right">0.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>VAT</span></Td>
<td align="right">0.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>Total Due</span></Td>
<td align="right">25.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>Paid</span></Td>
<td align="right">25.00</td>
</tr>
<tr>
<Td class="ash_backg"><span>Change</span></Td>
<td align="right">0.00</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Thank You dear customer</td>
</tr>
<tr>
<td>VAT Inclusive Where Applicable</td>
</tr>
</table>
</body>
</html>
You can use CSS media types. Use one for the screen to make it look nice and one for print, to make it plain.
For example:
#media screen
{
p.test {font-family:verdana,sans-serif;font-size:14px;}
}
#media print
{
p.test {font-family:times,serif;font-size:10px;}
}
Yes, you can print the document as the above and you have to use the separate style sheet for the screen display and printing. CSS rules are:
#media screen
{
//Css
}
#media print{
#page { size:250px 375px; margin: 4px }
body{font-family:"Courier New", Courier, monospace; font-size:8px;}
.f1{text-transform:uppercase; display:block; text-align:center;}
.f2{text-transform:uppercase; display:block; margin-left:10px;}
.border_bottom{ border-bottom:2px dashed #000;}
.border_top{border-top:2px dashed #000;}
.body_table{border:1px dashed #CCCCCC; padding:.5em;}
}
In these you can describe the page size, colors and many more things Just Google the CSS Print specification and you would know more.
But, I think the another problem involved in your i.e. print using POS printer to print it. For that I would Like to suggest the way are:
Two simple ways to do it, depending on how much interference you're willing to accept in your interface.
Firstly, you can just use JavaScript to trigger your receipt page/iframe to print. This option is a little klunky, as it requires the cashier to confirm the print in the system dialogue.
But secondly, you always have the option of sharing each station's printer on the network. Your server-side component can print directly to it. And if it's a *nix server, it's pretty easy to do once each station's printer has added to / shared with the server. In PHP (with CUPs installed, I imagine):
// attempt to pipe to 'lp -d printername'
if (`echo "{$text}" | lp -d {$printer_name}`) {
// print successful
return true;
} else {
// print failed
return false;
}
For second method, If you're running a windows server, it's probably much more complicated.

Email Div Content

I am trying to email the content of a Div. We have a booking system online and the user selects what options they want, then submit the form. It displays their information on the next page for them to print. I also want a copy of that emailed to them and us.
I liked the look of Jonathon Sampson's email div using ajax script. But it does not work for me. The email always comes back saying 'null' even if I give it a simple Div with one word written in it.
I do not know enough about PHP and have previously used CGI. THe problem with CGI is I cannot style the email. An the problem that I have found with PHP so far is that although I can add HTML to the email I cant decide what I want displayed where, and put returns from peoples forms inside DIVs in the HTML email.
If you take a look at the following page you will get a look at the Booking PAge. This page is where the initial form submission returns its information to. Everything inside the DIV tag 'booking-quote' I want emailed to the user one way or the other. Attached is the code
.
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<div align="right" style="padding-top:10px;" id="booking_quote">
<table width="775" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="775" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-left-30px.gif); background-repeat:no-repeat;"> </td>
<td bgcolor="#263D51" style="border-left:1px solid #FFF; border-right:1px solid #FFF; padding-left:5px;"><div align="left" class="Text_normal" style="font-size:13px; color:#FFF;">Customer Records</div></td>
<td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-right-30px.gif); background-repeat:no-repeat;"> </td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:10px;"><div align="center">
<table width="755" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><div align="left">
<table width="490" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-T" height="6"></td>
<td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td width="478"><table width="478" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top"><div align="left" class="Text_normal">
<table width="230" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77" valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Name</div></td>
<td width="153" valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_first-name"];?> <?php echo $_POST["CD_mid-initial"];?> <?php echo $_POST["CD_surname"];?></div></td>
</tr>
<tr>
<td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Address</div></td>
<td valign="top" style="font-size:13px; color:#333;"><div align="left"> <?php echo $_POST["CD_address-L1"];?> <br />
<?php echo $_POST["CD_address-L2"];?> <br />
<?php echo $_POST["CD_address-settlement"];?><br />
<?php echo $_POST["CD_address-county"];?><br />
<?php echo $_POST["CD_address-post-code"];?><br />
<?php echo $_POST["CD_address-country"];?></div></td>
</tr>
</table>
</div></td>
<td width="50%" valign="top"><div align="right" class="Text_normal">
<table width="230" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77" valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Date of Birth</div></td>
<td width="153" valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_DOB-day"];?>/<?php echo $_POST["CD_DOB-month"];?>/<?php echo $_POST["CD_DOB-year"];?></div></td>
</tr>
<tr>
<td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Email</div></td>
<td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_email"];?></div></td>
</tr>
<tr>
<td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Telephone</div></td>
<td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_telephone"];?></div></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
</div></td>
<td width="255" valign="top"><div align="right">
<table width="250" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-T" height="6"></td>
<td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td><div align="center" class="Text_normal">
<table width="230" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-right:12px;"><div align="left" style="color:#999;">Highest Current Qualifiacation</div></td>
</tr>
<tr>
<td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_experience-qualifications"];?></div></td>
</tr>
<tr>
<td width="230" valign="top" style="padding-right:12px; padding-top:5px;"><div align="left" style="color:#999;">Total Logged Dives to Date</div></td>
</tr>
<tr>
<td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_experience-dives"];?></div></td>
</tr>
</table>
</div></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<br />
<table width="775" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="775" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-left-30px.gif); background-repeat:no-repeat;"> </td>
<td bgcolor="#263D51" style="border-left:1px solid #FFF; border-right:1px solid #FFF; padding-left:5px;"><div align="left" class="Text_normal" style="font-size:13px; color:#FFF;">Details</div></td>
<td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-right-30px.gif); background-repeat:no-repeat;"> </td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-top:10px;"><div align="center">
<table width="755" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="575"><div align="left" class="Text_normal">
<table width="565" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-T" height="6"></td>
<td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td width="553"><table width="553" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="428" valign="top" style="padding-bottom:3px; border-bottom:1px solid #CCC;"><div align="left" class="Text_Sub_Title"><?php echo $_POST["programme"];?></div></td>
<td width="125" valign="top" style="padding-bottom:3px; border-bottom:1px solid #CCC;"><div align="right" class="Text_Sub_Title" style="color:#333;">£<?php echo $_POST["Prog_total"];?></div></td>
</tr>
<tr>
<td colspan="2" valign="top" style="padding-top:3px;"><ul>
<div><?php echo $_POST["Prog_Sum_Sub_Open_Water_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Open_Water_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Refresh_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Refresh_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Advanced_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dives_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Safari_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Safari_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_2"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_3"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_4"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_5"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_6"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_7"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Discover_Safari_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Discover_Safari_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Equipment_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_2"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_3"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_PADI_Materials_Fees_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_PADI_Materials_Fees_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_0"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_1"];?></div>
<div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_2"];?></div>
</ul></td>
</tr>
</table></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
<br />
<table width="565" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-T" height="6"></td>
<td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td width="553"><table width="553" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="428" valign="top"><div align="left" class="Text_Sub_Title"><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package"];?></div></td>
<td width="125" valign="top"><div align="right" class="Text_Sub_Title" style="color:#333;"><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package_total"];?></div></td>
</tr>
<tr>
<td colspan="2" valign="top" style="padding-top:3px;"><ul>
<div>
<div><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package_details"];?></div>
</div>
</ul></td>
</tr>
</table></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
</div></td>
<td width="180" valign="top"><div align="right">
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6" colspan="3" valign="middle" class="Text_normal" style="background:url(../../../IMAGES_A/Structure/Headers/blue-Semicircle-170px.jpg); height:25px;"><div align="left" style="padding-left:20px; padding-top:4px; color:#FFF; font-size:13px; font-weight:bold;">Summary</div></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td width="158" bgcolor="#FFF"><div align="center" class="Text_normal" style="font-size:18px; color:#333; padding-top:12px; padding-bottom:12px; border-bottom:1px solid #CCC;">£<?php echo $_POST["Basket_Total"];?><span style="font-size:13px; color:#666; padding-left:4px;">incl. VAT</span></div>
<div align="center" class="Text_normal" style="font-size:12px; color:#666; padding-top:12px; padding-bottom:12px;"> <?php echo $_POST["Basket-Total-Duration-Text"];?><br />
<span style="font-size:10px; color:#666; padding-left:4px;">incl. arrival and departure day</span></div></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
<br />
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6" colspan="3" valign="middle" class="Text_normal" style="background:url(../../../IMAGES_A/Structure/Headers/blue-Semicircle-170px.jpg); height:25px;"><div align="left" style="padding-left:20px; padding-top:4px; color:#FFF; font-size:13px; font-weight:bold;">Start Date</div></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-L" width="6"></td>
<td width="158" bgcolor="#FFF"><div align="left" class="Text_basic" style="padding-top:12px; padding-bottom:12px;">
<div align="center"><span style="font-size:14px; color:#666; padding-left:10px;" align="left" id="Prog-Start-Date-Text"></span><span class="Text_normal" style="font-size:12px; color:#666; padding-top:12px; padding-bottom:12px;"><?php echo $_POST["Prog_start-date"];?></span></div>
</div></td>
<td class="Corner-Box-WhiteGrey-R" width="6"></td>
</tr>
<tr>
<td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
<td class="Corner-Box-WhiteGrey-B" height="6"></td>
<td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<br />
</div>
</body>
</html>
You have the id of the div as "booking_quote" in the HTML, not "booking-quote". Make sure you're using "booking-quote" in all places. Since you didn't attach the JavaScript code, it's hard to see what's going on, but the easiest thing would be to
Put a form tag on your page. Give it an id of "my-form" or whatever.
attach an event to your form's submit method
in the method, take the contents of the div and put them into a hidden form field
Using jQuery, it would be something like:
$('form#my-form').submit(function()
{
$('input#my-hidden-field').val($('div#booking-quote').text())
});
It sounds like you have magic quotes turned on in your PHP setup. Try wrapping your $message variable in stripslashes.

Categories