Generate responsive tables on gmail e-mails with php - php

I would like to send responsive tables with PHP and I would like to manage to look nice on mobiles, especially on Gmail . Because gmail does NOT supports all CSS properties, the usual method for creating responsive tables does not work in e-mails. So it is needed to find another method to create responsive tables.
I have find a solution which could be work on gmail, but I have still problems with CSS.
The PHP code which sends responsive table in e-mail:
<?php
//E-mail recipient (Tested on gmail)
//$to = "SOMETHING#GMAIL.COM";
$to = "RECIPIENT E-MAIL ADRESS COMES HERE";
$subject = "Responsive table";
$message = '
<html>
<head>
<meta name="viewport" charset="UTF-8" content="width=device-width, initial-scale=1">
<style type="text/css">
#media only screen and (max-width: 800px){
#templateColumns{
width:100% !important;
}
.templateColumnContainer{
display:block !important;
width:100% !important;
}
.templateColumnContainer table{
border: 1px !important;
cellpadding:1px !important;
}
.abc{
display:table-cell !important;
width:50% !important;
}
.leftColumnContent{
font-size:16px !important;
line-height:125% !important;
}
}
</style>
</head>
</body>
<table border="1" cellpadding="0" cellspacing="0" width="600" id="templateColumns">
<tr>
<th colspan="7" align="center">Employees</th>
</tr>
<tr>
<td align="left" valign="center" class="abc" style="display:none;">
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
Employee ID
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
Last Name
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
First Name
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
E-mail
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
Office
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
Reports to
</tr>
</table>
<table border="1" cellpadding="10" cellspacing="0" width="100%">
<tr>
Job title
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
ID-12345
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
John
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
Doe
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
a#a.com
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
Office 1
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
Michael
</tr>
</table>
</td>
<td align="center" valign="top" width="12.5%" class="templateColumnContainer">
<table cellspacing="0" width="100%">
<tr>
Librarian
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
//Sender E-mail adress
//$headers .= 'From: <info#mywebsite.com>' . "\r\n";
$headers .= 'From: <SENDER E-MAIL ADDRESS COMES HERE>' . "\r\n";
mail($to,$subject,$message,$headers);
?>
I highlighted the problem on the following picture:
https://i.ibb.co/4dHsgHq/Mobile-picture.png
I would like also to add header row to the higher screen view, because it is now missing:
https://i.ibb.co/r41jVcp/PC-picture.png

Related

While creating PDF file,Table alignment between rows not working in TCPDF

Output of the PDF file
I am generating PDF file using TCTDF. I am fetching data from table in TCPDF.
I want to connect the table in flow but I am getting the output like attached image. I am trying but its not working. When I start $htmlcontent without closing the table tag for 2nd code it also showing error. Even CSS is not working for margin between two tables
$htmlcontent ='
<html>
<head>
<meta http-equiv="Content-Language" content="hi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
td{
height: 8px;
}
</style>
</head>
<body>
<!-- ============================== Logo and address ================================= -->
<table class="table table-hover" border="0" cellpadding="8" cellspacing="0">
<tr>
<td>
<center>
<img src="../assests/images/order_logo.gif" height="75" width="150"/>
</center>
</td>
<td style="text-align:right;">
<p><strong style="font-size: 12px; color:#245580;">SCS Technology</strong><br/>
The Address, Koregaon Park, <br/>
Pune, Maharashtra 411001<br/>
<strong>Mobile: </strong> +91 9988776655<br/>
<strong>Email: </strong> company#domain.com<br/>
</p>
</td>
</tr>
</table>
<p style="border-top: 2px solid #eb8b8b;"></p>
<!-- ============================== Customer name and address ================================= -->
<table class="table table-hover" border="0" cellpadding="8" cellspacing="0">
<tr>
<td style="text-align:left;">
<p><strong style="font-size: 12px; color:#245580;">INVOICE TO:</strong><br/><br/>
<strong style="font-size: 12px;">'.$clientName.'</strong><br/>
<strong>Mobile: </strong> '.$clientContact.'<br/>
</p>
</td>
<td>
<table class="table table-hover" border="0" cellpadding="5" cellspacing="0">
<tr colspan="2">
<th> </th>
<th>Order No : '.$clientName.'</th>
</tr>
<tr colspan="2">
<th> </th>
<th>Invoice Date : '.$orderDate.'</th>
</tr>
<tr colspan="2">
<th> </th>
<th>GST No : APSG6656SRT</th>
</tr>
</table>
</td>
</tr>
</table>
<p style="border-top: 2px solid #eb8b8b;"></p>
<br /><br />
<!-- ============================== Order Information ================================= -->
<table class="table table-hover" border="1" cellpadding="8" cellspacing="0">
<tr>
<th colspan="5" style="text-align:center; background-color:#eb8b8b; font-weight:bold;">Order Details</th>
</tr>
<tr style="text-align:center; background-color:#d9edf7; font-weight:bold;">
<th width="10%">No</th>
<th width="45%">Description</th>
<th width="15%">Price</th>
<th width="15%">Quantity</th>
<th width="15%">Total Price</th>
</tr>
</table>
';
$pdf->writeHTML($htmlcontent, true, false, false, false, '');
$orderItemSql = "SELECT order_item.product_id, order_item.rate, order_item.quantity, order_item.total,
product.product_name FROM order_item
INNER JOIN product ON order_item.product_id = product.product_id
WHERE order_item.order_id = $orderId";
//$orderItemResult = $connect->query($orderItemSql);
$order = mysqli_query($con, $orderItemSql);
$i=0;
while ($orderData1 = mysqli_fetch_array($order)) {
$product_name = $orderData1['product_name'];
$order_quantity = $orderData1['quantity'];
$order_rate = $orderData1['rate'];
$order_total = $orderData1['total'];
$i++;
$htmlcontent ='
<table class="table table-hover" border="1" cellpadding="8" cellspacing="0" style="margin-top:-20px !important;">
<tr>
<td width="10%">'.$i.'</td>
<td width="45%">'.$product_name.'</td>
<td width="15%">'.$order_quantity.'</td>
<td width="15%">'.$order_rate.'</td>
<td width="15%">'.$order_total.'</td>
</tr>
</table>
';
$pdf->writeHTML($htmlcontent, true, false, false, false, '');
}
$htmlcontent ='
<table class="table table-hover" border="1" cellpadding="8" cellspacing="0" style="margin-top:-20px !important;">
<tr>
<td width="85%" style="text-align:right; font-weight:bold;">Sub Total</td>
<td width="15%">'.$subTotal.'</td>
</tr>
<tr>
<td width="85%" style="text-align:right; font-weight:bold;">Discount</td>
<td width="15%">'.$discount.'</td>
</tr>
<tr>
<td width="85%" style="text-align:right; font-weight:bold;">GST 18%</td>
<td width="15%">'.$gstn.'</td>
</tr>
<tr>
<td width="85%" style="text-align:right; font-weight:bold;">Total</td>
<td width="15%">'.$grandTotal.'</td>
</tr>
</table>
<br /><br />
</body>
</html>
<p style="border-top: 2px solid #eb8b8b;"></p>
';
$pdf->writeHTML($htmlcontent, true, false, false, false, '');
//------------------------------------------------------
}
}
The second parameter to writeHTML controls whether a new line should be added. Setting it to false should do the trick:
$pdf->writeHTML($htmlcontent, false, false, false, false, '');
^^^^^

HTML Purifier for webmail

I'm working on small webmail client. For safely embedding html I want to use HTML Purifier (BTW: it's a good idea?).
I checked it with several emails and some problems. One email (from Google) is having something like this:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="4%">
<td width="92%" style="padding-top:18px; padding-bottom:10px; opacity:0.7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<td width="30%">
<img style="display:inline-block;" height="26" src="https://www.gstatic.com/local/guides/email/images/photo-impact/googlelogo_light_clr-f040d5d9.png">
<td>
<td width="70%" style="text-align:right">
</td>
</tbody>
</table>
Converts to:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%">
</td><td width="92%" style="padding-top:18px;padding-bottom:10px;opacity:.7;">
</td><td width="30%">
<img style="display:inline-block;" height="26" src="https://www.gstatic.com/local/guides/email/images/photo-impact/googlelogo_light_clr-f040d5d9.png" alt="googlelogo_light_clr-f040d5d9.png">
</td><td>
</td><td width="70%" style="text-align:right;">
</td>
</tr></table>
I don't know why it remove second <table> tag (also it close wrong <td> and removes <tbody>). Is it possible to change HTML Purifier to make it work for those situations?

Welcome mail php when someone signups

I trying to make a php code where if someone sign ups in to my website, it will automatically sends the welcome mail (php file). but i could n't able to figure it out how to add the mail-php file/body to the php script whiich says
mail ();
My php script as follows::
<?php
//15 2 2015
session_start();
if(!isset($_SESSION["login"]))
header("location:logout.php");
?>
<?php include('contactus-freelancer.php'); ?>
<?php include('../db.php'); ?>
<?php
$email = $_SESSION['email'];
$to = "$email";
$subject = "Welcome mail";
mail ('''what goes here is my question'''');
echo '';
?>
My mailing script as followsL::
<?php include('home.php'); ?>
<?php
//15 2 2015
session_start();
if(!isset($_SESSION["login"]))
header("location:logout.php");
?>
<?php include('db.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no" /> <!-- disable auto telephone linking in iOS -->
<title>Respmail is a response HTML email designed to work on all major email platforms and smartphones</title>
</head>
<body bgcolor="#E1E1E1" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<center style="background-color:#E1E1E1;">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;">
<tr>
<td align="center" valign="top" id="bodyCell">
<table bgcolor="#E1E1E1" border="0" cellpadding="0" cellspacing="0" width="500" id="emailHeader">
<!-- HEADER ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="10" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // END -->
</table>
<table bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0" width="500" id="emailBody">
<?php
$email = $_SESSION['email'];
$sql = "SELECT * FROM fuser WHERE email = '$email' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
?>
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<!--
The centering table keeps the content
tables centered in the emailBody table,
in case its width is set to 100%.
-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="color:#FFFFFF;" bgcolor="#3498db">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<!--
The flexible container has a set width
that gets overridden by the media query.
Most content tables within can then be
given 100% widths.
-->
<table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td align="center" valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<!--
The content table is the first element
that's entirely separate from the structural
framework of the email.
-->
<table border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" class="textContent">
<h1 style="color:#FFFFFF;line-height:100%;font-family:Helvetica,Arial,sans-serif;font-size:35px;font-weight:normal;margin-bottom:5px;text-align:center;"><small>Hello <?php echo strtoupper ($row["name"]); ?> </small><br> <br>Welcome to GraduateFreelancers</h1>
<h2 style="text-align:center;font-weight:normal;font-family:Helvetica,Arial,sans-serif;font-size:23px;margin-bottom:10px;color:#205478;line-height:135%;"><small>OUR JOB IS TO FIND YOU A JOB</small></h2>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">GraduateFreelancers is India’s one of the growing online career and recruitment resource with its global essencia technology provides relevant profiles to employers and relevant jobs to job-seekers across industry verticals, experience levels and geographies. Best rated by people have registered on the site over largest Indian network.</div>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<tr mc:hideable>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#F8F8F8">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td align="center" valign="top" width="500" class="flexibleContainerCell">
<table border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- CONTENT TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" class="textContent">
<h3 mc:edit="header" style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;">Thank You</h3>
<div mc:edit="body" style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-left:-25%; margin-bottom:0;color:#5F5F5F;line-height:135%; width:150%;">Let me take this opportunity to thank you for choosing GraduateFreelancers to provide you the finest opportunities and services. We are proud to welcome satisfied freelancers and look forward to many years of working together.<br><br>If you have any questions about our services, we invite you to get in touch with out customaer care available at <i><b>contact#graduatefreelancers.in</b></i>, and we will be happy to assist you 24/7.</div>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" class="flexibleContainerBox">
<table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width: 100%;">
<tr>
<td align="left" class="textContent">
<h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:CENTER; width:130%;">Complete your Profile</h3>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;">We care about your career more than anyone else, which gives us an opportunity to let you know that a complete profile with uploaded CV gets noticed by Recruiters more than the othere who haven't.</div>
</td>
</tr>
</table>
</td>
<td align="right" valign="middle" class="flexibleContainerBox">
<table class="flexibleContainerBoxNext" border="0" cellpadding="0" cellspacing="0" width="210" style="max-width: 100%;">
<tr>
<td align="left" class="textContent">
<h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center; margin-right:-50%; width:180%;">Upload a Profile picture</h3>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:155%; margin-right:-50%; width:180%;">Recruiters get what they see. And now to help them get to know you better, we requerst you to take a bit effort to upload your profile picture.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr style="padding-top:0;">
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td style="padding-top:0;" align="center" valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="50%" class="emailButton" style="background-color: #3498DB;">
<tr>
<td align="center" valign="middle" class="buttonContent" style="padding-top:15px;padding-bottom:15px;padding-right:15px;padding-left:15px;">
<a style="color:#FFFFFF;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:20px;line-height:135%;" href="www.graduatefreelancers/freelancerssign/" target="_blank">LogIn Here</a>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- MODULE ROW // -->
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td align="center" valign="top" width="500" class="flexibleContainerCell">
<table border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- CONTENT TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" class="textContent">
<h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;">Projects Related to your Streams</h3>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-top:3px;color:#5F5F5F;line-height:135%;">Now let us get to the business. Here are some paid projects recruiters have posted from past two weeks.</div>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- MODULE DIVIDER // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td align="center" valign="top" width="500" class="flexibleContainerCell">
<table class="flexibleContainerCellDivider" border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" style="padding-top:0px;padding-bottom:0px;">
<!-- CONTENT TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" style="border-top:1px solid #C8C8C8;"></td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // END -->
<?php
$category1 = $row["category1"];
$sql2 = "SELECT * FROM input WHERE category1 = '$category1' ORDER BY date DESC LIMIT 2";
$result2 = $conn->query($sql2);
if ($result2->num_rows > 0) {
while($row2 = $result2->fetch_assoc()) {
?>
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" class="flexibleContainerBox">
<table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width:100%;">
<tr>
<td align="left" class="textContent">
<h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:10px;margin-bottom:3px;text-align:center; width:130%; margin-left:10%;"><?php echo ($row2["title"]); ?></h3>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%; margin-left:10%;"><?php echo ($row2["description"]); ?></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<?php }
} else {
echo "0 results";
}
?>
<?php
$category2 = $row["category2"];
$sql3 = "SELECT * FROM input WHERE category1 = '$category2' ORDER BY date DESC LIMIT 2";
$result3 = $conn->query($sql3);
if ($result3->num_rows > 0) {
while($row3 = $result3->fetch_assoc()) {
?>
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="30" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" class="flexibleContainerBox">
<table border="0" cellpadding="0" cellspacing="0" width="210" style="max-width:100%;">
<tr>
<td align="left" class="textContent">
<h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:10px;margin-bottom:3px;text-align:center; width:130%; margin-left:10%;"><?php echo ($row3["title"]); ?></h3>
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;margin-left:10%;"><?php echo ($row3["description"]); ?></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
<!-- // END -->
<?php }
} else {
echo "0 results";
}
?>
<?php }
} else {
echo "0 results";
}
$conn->close();
?>
<!-- MODULE ROW // -->
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
<tr>
<td valign="top" width="500" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" class="flexibleContainerBox" style="background-color:#5F5F5F;">
<table border="0" cellpadding="30" cellspacing="0" width="100%" style="max-width:100%;">
<tr>
<td align="center" class="textContent">
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">How are we doing. Please take a moment to give us your feed back.</div><br>
<h3 style="color:#FFFFFF;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;"><b>FEED BACK</b></h3>
</td>
</tr>
</table>
</td>
<td align="center" valign="top" class="flexibleContainerBox" style="background-color:#27ae60;">
<table class="flexibleContainerBoxNext" border="0" cellpadding="30" cellspacing="0" width="100%" style="max-width:100%;">
<tr>
<td align="center" class="textContent">
<div style="text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;">Are we doing good?. Please let your Appreciation reach us.</div><br>
<h3 style="color:#FFFFFF;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;"><b>DONATE</b></h3>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
<!-- // MODULE ROW -->
</td>
</tr>
</table>
</center>
</body>
</html>
NOTE: i have to get the whole mailing script as mail to the user who signs up
Any Suggestions are Appreciated..
Man I'm not sure if you also know what you want, On your question you ask how to send email when a use signs up on your system, but the code you pasted here, have nothing to do with signing up.
From reading the comments, I assume that you want to send an email with html template. I tried to work on your code but it's too long I just did the first 300 lines the rest you can finish it by yourself, here:
<?php
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // set content type to html
$headers = "From: Your System Name <no-reply#your-system.com> \r\n";
$message = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\" id=\"bodyTable\" style=\"table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;\" align=\"center\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\" id=\"bodyCell\">";
$message .="<table bgcolor=\"#E1E1E1\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" id=\"emailHeader\">";
// HEADER ROW
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
// CENTERING TABLE
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
// FLEXIBLE CONTAINER
$message .= "<table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">";
$message .= "<tr>";
$message .="<td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">";
// CONTENT TABLE //
$message .="<table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$message .="<tr>";
$message .="</tr>";
$message .="</table>";
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// FLEXIBLE CONTAINER
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// CENTERING TABLE
$message .="</td>";
$message .="</tr>";
// END
$message .="</table>";
$message .="<table bgcolor=\"#FFFFFF\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" id=\"emailBody\">";
$email = $_SESSION['email'];
$sql = "SELECT * FROM fuser WHERE email = '$email' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
//CENTERING TABLE
/*
The centering table keeps the content
tables centered in the emailBody table,
in case its width is set to 100%.
*/
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"color:#FFFFFF;\" bgcolor=\"#3498db\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
/* FLEXIBLE CONTAINER
The flexible container has a set width
that gets overridden by the media query.
Most content tables within can then be
given 100% widths.
*/
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">";
/* CONTENT TABLE // -->
<!--
The content table is the first element
that's entirely separate from the structural
framework of the email.
*/
$message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\" class=\"textContent\">";
$message .="<h1 style=\"color:#FFFFFF;line-height:100%;font-family:Helvetica,Arial,sans-serif;font-size:35px;font-weight:normal;margin-bottom:5px;text-align:center;\"><small>Hello".strtoupper($row['name'])."</small><br> <br>Welcome to GraduateFreelancers</h1>";
$message .="<h2 style=\"text-align:center;font-weight:normal;font-family:Helvetica,Arial,sans-serif;font-size:23px;margin-bottom:10px;color:#205478;line-height:135%;\"><small>OUR JOB IS TO FIND YOU A JOB</small></h2>";
$message .="<div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#FFFFFF;line-height:135%;\">GraduateFreelancers is India’s one of the growing online career and recruitment resource with its global essencia technology provides relevant profiles to employers and relevant jobs to job-seekers across industry verticals, experience levels and geographies. Best rated by people have registered on the site over largest Indian network.</div>";
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// CONTENT TABLE
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// FLEXIBLE CONTAINER
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// CENTERING TABLE
$message .="</td>";
$message.= "</tr>";
$message .="<tr mc:hideable>";
$message .="<td align=\"center\" valign=\"top\">";
// CENTERING TABLE
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
//FLEXIBLE CONTAINER
$message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">";
$message .="<tr>";
$message .="<td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">";
// CONTENT TABLE
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// FLEXIBLE CONTAINER
$message .="</td>";
$message .="</tr>";
$message .="</table>";
// CENTERING TABLE
$message.="</td>";
$message .="</tr>";
// MODULE ROW
// MODULE ROW //
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
//CENTERING TABLE //
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"#F8F8F8\">";
$message.="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
// FLEXIBLE CONTAINER
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">";
$message .="<tr>";
$message .="<td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">";
$message .="<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\">";
$message.="<tr>";
$message .="<td align=\"center\" valign=\"top\">";
// CONTENT TABLE
$message .="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$message .="<tr>";
$message .="<td valign=\"top\" class=\"textContent\">";
$message .="<h3 mc:edit=\"header\" style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;\">Thank You</h3>
<div mc:edit=\"body\" style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-left:-25%; margin-bottom:0;color:#5F5F5F;line-height:135%; width:150%;\">Let me take this opportunity to thank you for choosing GraduateFreelancers to provide you the finest opportunities and services. We are proud to welcome satisfied freelancers and look forward to many years of working together.<br><br>If you have any questions about our services, we invite you to get in touch with out customaer care available at <i><b>contact#graduatefreelancers.in</b></i>, and we will be happy to assist you 24/7.</div>
</td>
</tr>
</table>
// CONTENT TABLE -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>";
// MODULE ROW -->
// <!-- MODULE ROW // -->
$message.="<tr>
<td align=\"center\" valign=\"top\">
<!-- CENTERING TABLE // -->
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td align=\"center\" valign=\"top\">
<!-- FLEXIBLE CONTAINER // -->
<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">
<tr>
<td valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">
<!-- CONTENT TABLE // -->
<table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td align=\"left\" valign=\"top\" class=\"flexibleContainerBox\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"210\" style=\"max-width: 100%;\">
<tr>
<td align=\"left\" class=\"textContent\">
<h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:CENTER; width:130%;\">Complete your Profile</h3>
<div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:135%; width:130%;\">We care about your career more than anyone else, which gives us an opportunity to let you know that a complete profile with uploaded CV gets noticed by Recruiters more than the othere who haven't.</div>
</td>
</tr>
</table>
</td>
<td align=\"right\" valign=\"middle\" class=\"flexibleContainerBox\">
<table class=\"flexibleContainerBoxNext\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"210\" style=\"max-width: 100%;\">
<tr>
<td align=\"left\" class=\"textContent\">
<h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center; margin-right:-50%; width:180%;\">Upload a Profile picture</h3>
<div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;color:#5F5F5F;line-height:155%; margin-right:-50%; width:180%;\">Recruiters get what they see. And now to help them get to know you better, we requerst you to take a bit effort to upload your profile picture.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>";
// MODULE ROW -->
// MODULE ROW //
$message .="<tr>
<td align=\"center\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr style=\"padding-top:0;\">
<td align=\"center\" valign=\"top\">
<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">
<tr>
<td style=\"padding-top:0;\" align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">
<!-- CONTENT TABLE // -->
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"50%\" class=\"emailButton\" style=\"background-color: #3498DB;\">
<tr>
<td align=\"center\" valign=\"middle\" class=\"buttonContent\" style=\"padding-top:15px;padding-bottom:15px;padding-right:15px;padding-left:15px;\">
<a style=\"color:#FFFFFF;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:20px;line-height:135%;\" href=\"www.graduatefreelancers/freelancerssign/\" target=\"_blank\">LogIn Here</a>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>";
// MODULE ROW -->
// MODULE ROW // -->
// MODULE ROW // -->
$message .="<tr>
<td align=\"center\" valign=\"top\">
<!-- CENTERING TABLE // -->
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td align=\"center\" valign=\"top\">
<!-- FLEXIBLE CONTAINER // -->
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" class=\"flexibleContainer\">
<tr>
<td align=\"center\" valign=\"top\" width=\"500\" class=\"flexibleContainerCell\">
<table border=\"0\" cellpadding=\"30\" cellspacing=\"0\" width=\"100%\">
<tr>
<td align=\"center\" valign=\"top\">
<!-- CONTENT TABLE // -->
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td valign=\"top\" class=\"textContent\">
<h3 style=\"color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:center;\">Projects Related to your Streams</h3>
<div style=\"text-align:center;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-top:3px;color:#5F5F5F;line-height:135%;\">Now let us get to the business. Here are some paid projects recruiters have posted from past two weeks.</div>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>";
mail($email, "Welcome", $message,$headers);
?>
And also I would suggest that you use PDO prepared statements. let me know if the code doesn't make sense to you.
You can use this for reference, refer the section "Sending HTML Email".
As of your question mail ('''what goes here is my question'''');
PHP mail function is formatted as
mail($to, $subject, $message, $headers);
Please check the PHP doc for mail function for more readings.

How to send mail to the more than one users in php?

i am currently having problem sending mail to more than one users in php, i am able to send to one user at a time but the mail function only sends the mail to the first user and does not send the mail to the second one seperated by comma in $to variable.
Here is my code:
<?php
$reg = #$_POST['reg'];
if($reg) {
$to = "mail1#mail.com,mail2#mail.com";
$from = "hootpile#hootpile.com";
$subject = 'Hi VITian !';
$message = '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Hi VITian.</title></head><body style="margin:0px; font-family:Tahoma, Geneva, sans-serif;"><center>
<table id="ecxbodyTable" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0" align="center" style="border-collapse:collapse;padding:0;background-color:#F2F2F2;height:100% !important;width:100% !important;">
<tbody>
<tr>
<td id="ecxbodyCell" valign="top" align="center" style="padding:20px;border-top:0;height:100% !important;width:100% !important;">
<table id="ecxtemplateContainer" width="600" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;border:0;">
<tbody>
<tr>
<td valign="top" align="center" style="">
<table id="ecxtemplatePreheader" width="600" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;background-color:#FFFFFF;border-top:0;border-bottom:0;">
<tbody>
<tr>
<td class="ecxpreheaderContainer" valign="top" style="padding-top:9px;"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" style="">
<table id="ecxtemplateHeader" width="600" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;background-color:#FFFFFF;border-top:0;border-bottom:0;">
<tbody>
<tr>
<td class="ecxheaderContainer" valign="top" style="">
<table class="ecxmcnImageBlock" width="100%" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tbody class="ecxmcnImageBlockOuter">
<tr>
<td class="ecxmcnImageBlockInner" valign="top" style="padding:9px;">
<table class="ecxmcnImageContentContainer" width="100%" cellspacing="0" cellpadding="0" border="0" align="left" style="border-collapse:collapse;">
<tbody>
<tr>
<td class="ecxmcnImageContent" valign="top" style="padding-right:9px;padding-left:9px;padding-top:0;padding-bottom:0;">
<a class="" style="word-wrap:break-word;" target="_blank" title="" href="http://www.hootpile.com">
<img class="ecxmcnImage" width="90" align="left" style="max-width:125px;padding-bottom:0;display:inline !important;vertical-align:bottom;border:0;text-decoration:none;-ms-interpolation-mode:bicubic;" src="http://www.hootpile.com/userdata/profile_pics/BqUht7I39izV6Fn/resized_2015-04-10_1620.png" alt="Hootpile">
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" style="">
<table id="ecxtemplateBody" width="600" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;background-color:#FFFFFF;border-top:0;border-bottom:0;">
<tbody>
<tr>
<td class="ecxbodyContainer" valign="top" style="">
<table class="ecxmcnTextBlock" width="100%" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tbody class="ecxmcnTextBlockOuter">
<tr>
<td class="ecxmcnTextBlockInner" valign="top" style="">
<table class="ecxmcnTextContentContainer" width="600" cellspacing="0" cellpadding="0" border="0" align="left" style="border-collapse:collapse;">
<tbody>
<tr>
<td class="ecxmcnTextContent" valign="top" style="padding-top:9px;padding-right:18px;padding-bottom:9px;padding-left:18px;color:#606060;font-family:Helvetica;font-size:15px;line-height:150%;text-align:left;">
<h1 class="ecxnull" style="padding:0;display:block;font-family:Helvetica;font-size:40px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:-1px;text-align:left;color:#606060 !important;">
<strong style="color:#000000;display:block;font-family:helvetica,arial,sans-serif;font-size:24px;font-weight:bold;line-height:30px;text-align:left;text-transform:none;">
<span style="font-size:22px;">
<span style="color:#333333;font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.6em;">Join Hootpile Now.</span>
</span>
</strong>
</h1>
<p style="padding:0;color:#606060;font-family:Helvetica;font-size:15px;line-height:150%;text-align:left;">
<span style="background-color:#FFFFFF;color:#000000;font-family:courier,courier new,monospace;font-size:15px;line-height:18px;text-align:left;">Hootpile is social utility that is transforming how students at VIT University connect with each other.</span>
<span style="color:#000000;font-family:courier,courier new,monospace;font-size:15px;line-height:18px;"> We believe that students should be provided with a common platform to discuss everything, build anything. Hootpile is free from advertising, manipulation and exploitation. </span>
<br>
<br>
<span style="color:#000000;font-family:courier,courier new,monospace;font-size:15px;line-height:18px;">We can all be in one place but it starts from you, Join Now!</span>
<br>
<br>
<span style="background-color:#FFFFFF;color:#000000;font-family:courier,courier new,monospace;font-size:15px;line-height:18px;text-align:left;">Simple, beautiful, and ad-free.</span>
<br>
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="ecxmcnButtonBlock" width="100%" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tbody class="ecxmcnButtonBlockOuter">
<tr>
<td class="ecxmcnButtonBlockInner" valign="top" align="left" style="padding-top:0;padding-right:18px;padding-bottom:18px;padding-left:18px;">
<table class="ecxmcnButtonContentContainer" cellspacing="0" cellpadding="0" border="0" style="border-collapse:separate !important;border:2px solid #418bbc;border-radius:0px;background-color:#418bbc;">
<tbody>
<tr>
<td class="ecxmcnButtonContent" valign="middle" align="center" style="font-size:16px;padding:15px;">
<a class="ecxmcnButton " style="font-weight:bold;letter-spacing:normal;line-height:100%;text-align:center;text-decoration:none;color:#FFFFFF;word-wrap:break-word;" target="_blank" href="http://www.hootpile.com" title="Go to Hootpile">Go to Hootpile.</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" style="">
<table id="ecxtemplateFooter" width="600" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;background-color:#FFFFFF;border-top:0;border-bottom:0;">
<tbody>
<tr>
<td class="ecxfooterContainer" valign="top" style="padding-bottom:9px;">
<table class="ecxmcnTextBlock" width="100%" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tbody class="ecxmcnTextBlockOuter">
<tr>
<td class="ecxmcnTextBlockInner" valign="top" style="">
<table class="ecxmcnTextContentContainer" width="600" cellspacing="0" cellpadding="0" border="0" align="left" style="border-collapse:collapse;">
<tbody>
<tr>
<td class="ecxmcnTextContent" valign="top" style="padding-top:9px;padding-right:18px;padding-bottom:9px;padding-left:18px;color:#606060;font-family:Helvetica;font-size:11px;line-height:125%;text-align:left;">
<br>
<br>
<br>
<span style="font-size:14px;">
<span style="font-family:courier new,courier,lucida sans typewriter,lucida typewriter,monospace;">
<span>
Visit the
<a style="word-wrap:break-word;color:#606060;font-weight:normal;text-decoration:underline;" target="_blank" href="http://www.hootpile.com/manifesto">Hootpile Manifesto page.</a>
</span>
</span>
</span>
<br>
<br>
<br>
<br>
<span style="font-size:14px;">
<span style="font-family:courier new,courier,lucida sans typewriter,lucida typewriter,monospace;">
<strong>
<a style="word-wrap:break-word;color:#606060;font-weight:normal;text-decoration:underline;" target="_blank" href="http://www.hootpile.com">
<span style="color:#000000;">Hootpile.com</span>
</a>
</strong>
</span>
</span>
<br>
<br>
<br>
<br>
<span style="font-size:11px;">
<span style="font-family:courier new,courier,lucida sans typewriter,lucida typewriter,monospace;">
<span>
<span style="color:#D3D3D3;">If you dont want to receive </span>
<a target="_blank" style="word-wrap:break-word;color:#606060;font-weight:normal;text-decoration:underline;" href="http://ello.us3.list-manage2.com/unsubscribe?u=9ad48e023e0e67d4a8cda3fc9&id=eac7ac1a28&e=c73797a5f4&c=9d1407f6b5">
<span style="color:#D3D3D3;">emails</span>
</a>
<span style="color:#D3D3D3;">
from Hootpile
<br>
anymore, please
</span>
<a target="_blank" style="word-wrap:break-word;color:#606060;font-weight:normal;text-decoration:underline;" href="http://www.hootpile.com">
<span style="color:#D3D3D3;">unsubscribe here.</span>
</a>
<br>
<br>
<span style="color:#D3D3D3;">Hootpile, VIT University</span>
</span>
</span>
</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</center>
</body></html>';
$headers = "From: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
mail($to, $subject, $message, $headers);
}
?>
<form id="new_user" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" accept-charset="UTF-8" autocomplete="off">
<input type="submit" name="reg" value="send">
</form>
Use multiple time mail() function :
$to = "hootpile#gmail.com, hootpile2#gmail.com";
foreach(explode(',', $to) as $mail) {
mail(trim($mail), $subject, $message, $headers);
}
That will send an email for each user.

why my view page doesn't show out data in database mysql

I have successfully created log in and log out page..when the user success to log in using their username and password they will go to the view page but unfortunately the view page doesn't show out data in database mysql and also no error come out on that coding..
This is my viewpage.php
<html>
<?php
include("authenticationStaff.php");
include ("dbase.php");
?>
<body>
<table width="869" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="645" height="50" align="left" valign="middle"><strong>Welcome , You log in as <?php echo $_SESSION['SESS_STAFF_NAME'];?>
<td width="377" align="right" valign="middle"><strong>Log Out</strong></td>
</tr>
</table>
</center>
<?php
$query= "SELECT s.staff_id,s.staff_name,i.project_name,i.location,i.cost,i.pic,i.detail,i.file_name,i.file_type,i.file_size,i.file_content,i.staff_id
FROM staff s
JOIN inter1 i
on(s.staff_id = i.staff_id)
WHERE i.staff_id = '".$_SESSION['SESS_ID']."'";
$result = mysql_query($query);
?>
<tr>
<td colspan="4" align="left" valign="top" class="horizon_divider"><p> </p>
</td><td width="750" valign="top"><div align="center">
<h3>DATA</h3>
<table width="836" border="2" align="center" style= "background-color: #FFFFFF; color: #000000; margin: 0 auto;" >
<thead>
<tr bgcolor="#FFFFFF">
<th width="142">PROJECT NAME</th>
<th width="114">LOCATON</th>
<th width="94">COST</th>
<th width="151">PERSON IN CHARGE</th>
<th width="187">DETAIL</th>
<th width="187">ATTACHMENT</th>
<th width="88">ACTION</th>
</tr>
</thead>
<tbody>
<?php
while( $row = mysql_fetch_assoc( $result ) ){
echo
"<tr>
<td>{$row['project_name']}</td>
<td>{$row['location']}</td>
<td>{$row['cost']}</td>
<td>{$row['pic']}</td>
<td>{$row['detail']}</td>
<td></td>
<td><a href='editStaff.php?id={$row ['staff_id']}'>ADD NEW RECORD</a>||<a href='deleteStaff.php?id={$row ['staff_id']}'>DELETE</a></td> </tr> ";
}
?>
</tbody>
</table>
</table>
</body>
</html>
Can someone see where I am going wrong?if you need any more info then please let me know. thanks.

Categories