Shanti C 106 Posting Virtuoso

check this link, im not sure this is userful for you or not..
just for info.
http://books.google.co.in/books?id=Q9OP0ClTTvIC&pg=PA236&lpg=PA236&dq=if+(session_id()+%3D%3D+%22%22)+in+php+5&source=bl&ots=1E0yhfQHaO&sig=9qVWE4AtPs6W5Ed5OyYVKeYXP5o&hl=en&ei=pgApTqXMDcurrAeJp7nHBg&sa=X&oi=book_result&ct=result&resnum=7&ved=0CEYQ6AEwBg#v=onepage&q&f=false

Shanti C 106 Posting Virtuoso

This is my chage password script. This works ONLY if all the data fields entered correctly. Otherwise it gives several error messages. (Ex:incorrect username, incorrect pw etc)

Yes, the fields should not be null, if you enter nothing , then the query will result nothing,so the problem occurs.
Please clearly explain your requirement.

Shanti C 106 Posting Virtuoso

Try addslashes method.

Shanti C 106 Posting Virtuoso

check for the $id value , whether it is there(db table) or not.
And also remove single quotes for index here :

WHERE 'index'='$id'

if still eror:
print your query like :

echo $qry="UPDATE tblinfo SET idno='$idno', name='$name', address='$address', birthdate='$birthdate', contact='$contact', email='$email' WHERE 'index'='$id'";
$result=mysql_query($qry);

Try to excute the printed query in PHPMyAdmin,check what error comes.

Shanti C 106 Posting Virtuoso

you must have to close the printf function in line no 512.
like :

<?php printf( 'your content' );
Shanti C 106 Posting Virtuoso

you have missed semicolon in line 31.

karthik_ppts commented: good spot +5
Shanti C 106 Posting Virtuoso

HTML - is not a programming language, it is a markup language.
you should have a basic understanding of HTMl before you learn CSS.
CSS - CSS stands for Cascading Style Sheets, Styles define how to display HTML elements.
you should have a basic understanding of HTMl before you learn PHP.
PHP is a powerful tool for making dynamic and interactive Web pages.

Finally you should learn all of the above to become a good web developer.

check this for more details:
http://www.thesitewizard.com/html-tutorial/what-is-html.shtml

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

i just showed an example for USA only.
You just write same kind of code with your required links by observing red color lines in the above code.then it will work.
If you don't know the basics in java script. Please read the tutorials online and try to change your code accordingly.
Thank you.

Shanti C 106 Posting Virtuoso

check the code below:

<!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>
<script type="text/javascript">

var states = new Array();

states['Canada'] = new Array('Alberta','British Columbia','Ontario');
states['Mexico'] = new Array('Baja California','Chihuahua','Jalisco');
states['United States'] = new Array('California','Florida','New York');


// City lists
var cities = new Array();

cities['Canada'] = new Array();
cities['Canada']['Alberta']          = new Array('Edmonton','Calgary');
cities['Canada']['British Columbia'] = new Array('Victoria','Vancouver');
cities['Canada']['Ontario']          = new Array('Toronto','Hamilton');

cities['Mexico'] = new Array();
cities['Mexico']['Baja California'] = new Array('Tijauna','Mexicali');
cities['Mexico']['Chihuahua']       = new Array('Ciudad Juárez','Chihuahua');
cities['Mexico']['Jalisco']         = new Array('Guadalajara','Chapala');

cities['United States'] = new Array();
cities['United States']['California'] = new Array('Los Angeles','San Francisco');
cities['United States']['Californialinks'] = new Array('LosAngeles.html','SanFrancisco.html');
cities['United States']['Florida']    = new Array('Miami','Orlando');
cities['United States']['Floridalinks']    = new Array('Miami.html','Orlando.html');
cities['United States']['New York']   = new Array('Buffalo','new York');
cities['United States']['New Yorklinks']   = new Array('Buffalo.html','new York.html');


function setStates() {
  cntrySel = document.getElementById('country');
  stateList = states[cntrySel.value];
  changeSelect('state', stateList, stateList);
  setCities();
}

function setCities() {
  cntrySel = document.getElementById('country');
  stateSel = document.getElementById('state');
  cityList = cities[cntrySel.value][stateSel.value];
  cityLinksList = cities[cntrySel.value][stateSel.value+"links"];
  changeSelect('city', cityList, cityLinksList);
}

function changeSelect(fieldID, newOptions, newValues) {
  selectField = document.getElementById(fieldID);
  selectField.options.length = 0;
  for (i=0; i<newOptions.length; i++) {
    selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
  }
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  setStates();
});
function redirect()
{
	x=document.getElementById("city").value;
	window.location=x;
}
</script>

<style type="text/css">
  .make_selection_back { …
Shanti C 106 Posting Virtuoso

If you want to redirect to particular link based on drop down selection, user go button and capture the selected element in drop down, and redirect url.
Try to implement code and post your code here to fix.

Shanti C 106 Posting Virtuoso

i didn't get you clearly.

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

I have just given you an idea not exact code.
Then try yourself for the error like:
try to trace out the where is the error.
Means put echo for all posted data,
next echo the query and execute the query in PHPMYAdmin.
or post your entire code.

Shanti C 106 Posting Virtuoso

i tested the code and its not working its not inserting the data in database nor is it redirecting me to the payment page.

check your form action ,what is the redirect page name you have written there.If it is alertpayment.php page then change it to insert.php.

one thing should my form.php file be in the same directory as my insert.php?

off course, if your page is in other directory, you can give clear path of that page.

Shanti C 106 Posting Virtuoso

Use encryption methods before saving the credit card information in your database.
or
Use third party payment gateway , the will take care of all these.
then you need not to save credit card information in your database.

Shanti C 106 Posting Virtuoso

try this:
Lets assume $myvar variable is having values like:

$myvar='8','9','10';

and in your java script:

jsvar =new Array(<?php echo $myvar;?>);

then you can run a loop through java script variable like"

for(var k=0;k<jsvar.length;k++)
{
alert(jsvar[k]);
}
Shanti C 106 Posting Virtuoso

then try his:

$d = mktime(0,0,0,date("m"),1,date("Y"));
echo "Date: ".date("M/Y/d", $d);
Shanti C 106 Posting Virtuoso

whenever your are going to generate a bill then use this function to get current date:

echo Date('M/Y/d');

and save this in your database.

Shanti C 106 Posting Virtuoso

you have to give unique id for dynamically added input fields.Based on that ids you should have to calculate total.

Shanti C 106 Posting Virtuoso

inside insert.php wouldnt that just delete everyting inside our table we have just inserted on submiting the form?

flag=0 means unsuccessful transactions.

$q="insert into tablename ('','','','flag')values('','','',1)";

by this query , you will have flag 1 for all successful transactions.
So, no worry about unsuccessful transactions.

Don't run email code when transaction is unsuccessful.
Means if control went through success.php , means transaction is success.
and email that particular users details not all details.

Shanti C 106 Posting Virtuoso

so i should add the code
PHP Syntax (Toggle Plain Text)

1.
$q="delete from table name where flag=0";

$q="delete from table name where flag=0";
to my sucess.php file or fail.php?

No you just add the above query in the page from which we are going to payment page.not in success.php or fail.php pages.

Shanti C 106 Posting Virtuoso

hmm
here all we have to work with queries only.
first alter your table with flag like:

ALTER TABLE `table_name` ADD `flag` TINYINT NOT NULL DEFAULT '0';

then in insert.php page, your insert query should be like:

$q="insert into tablename ('','','','flag')values('','','',1)";

means here you insert the flag as 1 along with transaction information.because you don't know whether it will be success or fail.
and in your success.php, update your table row like:

update table name set flag=0 where primarykey=key;

then it means if flag=0 then it is your successful transaction.
and in payment page write this query to delete all unsuccessful payments:

$q="delete from table name where flag=0";

or just post your code for clear information.
thanks.

Shanti C 106 Posting Virtuoso

hmm.

check through this:

$query=mysql_query("SELECT * FROM Persons WHERE Id ='$Id'");
if (mysql_num_rows($query)==0)
Shanti C 106 Posting Virtuoso

ok then set flag and display button based on flag.

Shanti C 106 Posting Virtuoso

or try this:

[B] if ($name!="")[/B]
    {
       //start upload
       $location = "avatars/$name";
       move_uploaded_file($tmp_name,$location);

       $query = mysql_query("UPDATE Persons SET imagelocation='$location' WHERE Id ='$Id'");
   
       die("Your Profile Picture has been uploaded! <a href='member.php'>Back to Profile</a>");



    }
    else
    die("Please Select a File!");
Shanti C 106 Posting Virtuoso

first , i need some clarification,
what is the topic feature if that topic is locked????

and
set "is_lock" flag in your topics table in database,
then set it to 1 if it is locked, default is 0 means it is not locked.

Shanti C 106 Posting Virtuoso

i have to manually delete the temp store data in the database

you just write a query to delete unsuccessful transactions like:

$q="delete from table name where flag=0";

put this query before going to alertpayment.php
then all unsuccessful transactions will be deleted on regular basis.

Shanti C 106 Posting Virtuoso

ok then try this:

$("#owner_state").val($("#subject_state :selected").val());

this will work fine.

Shanti C 106 Posting Virtuoso

do i really have to submit the form data to a database or can i store it in some kind of variable

Yes.
if we stored all the data in some global variable,while payment or after payment if close our website, all the data set will be lost even if successfully done payment.

at lease get a sample of the code for the success.php file

i don't have any examples with me.
try to code like:
- a query to make inserted row flag with 1.
user customer if to find proper row which cam through success.php
- emailing functionality.
First try it and post here if you have any more queries.

Shanti C 106 Posting Virtuoso

before going to alertpayment page ,you just insert all data in your database with flag 0.
if payment is successfull in alertpayament, then redirect to success.php page in your website, in that success.php you just write code to make that inserted row flag to 1.then write code to email these details.
if payment is not successfull in alertpayament,then redirect it to failure.php page.
then delete the inserted data or leave that with flag 0.

the rows with flag 1 are meant to your successful transcations.

Shanti C 106 Posting Virtuoso

ok sorry.
try this:

$("#owner_state :selected").val($("#subject_state :selected").val());
Shanti C 106 Posting Virtuoso

ok.good.

Shanti C 106 Posting Virtuoso

when you are submitting your form then redirect it to one page called insert.php,
then redirect to https://www.alertpay.com/checkout".
just like this:

<form id="feedbackform" method="post" action="insert.php" >

in insert.php

// getting form values
//inserting code
// form
<script>
document.feedbackform.submit();
</script>
<form id="feedbackform" method="post" action="https://www.alertpay.com/checkout" >
// put required fields in hidden variable

</form>
Shanti C 106 Posting Virtuoso

check this once:

$("input#owner_dropdownname.option:selected").val($("input#subject_dropdownname.option:selected").val());

check the link for reference:
http://api.jquery.com/val/

Shanti C 106 Posting Virtuoso

try this:
and change according to your requirement.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function changeValue(x)
{
	var divEls = document.getElementsByTagName("div");
	var i = 0;
	
	for(i=0;i<divEls.length;i++)
	{
	divID=divEls[i].id;
	//alert(divID);
	//alert(x);
	if(divID == x)
		document.getElementById(divID).style.visibility = "visible";
	else
		document.getElementById(divID).style.visibility = "hidden";
	}
}
</script>
</head>
<body>
<select name="htmlcombo" id="htmlcombo" onChange="changeValue(this.value);">
 <option  value="0">Select</option>
    <option  value="1">Display Text1</option>
    <option  value="2">Display Text2</option>
    <option  value="3">Display Text3</option>
</select>

<div id="1" style="visibility:hidden" >hello1</div>
<div id="2" style="visibility:hidden">hello2</div>
<div id="3" style="visibility:hidden">hello3</div>
</body>
</html>
Shanti C 106 Posting Virtuoso

correct this line like:

tbl_sql="INSERT INTO tbl_user_post_requirement(user_id,verb_id,item_code,post_description,posted_on)VALUES('".$user_id."','".$vrb_id['verb_id']."','".$itm_code['item_code']."','".$post_description."','".$posted_on."')";
Shanti C 106 Posting Virtuoso

just change your code like this:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script type="text/javascript">
function addRow(tableid)
{	

	  $(document).ready(function(){

      $("button").click(function(){
  	  var clonedRow = $("#" + tableid + " tr:last").clone(); //this will grab the lasttable row.
	  $("#" + tableid + " tr:last").append(clonedRow); //add the row back to the table
      });
    });
	
}
</script>
</head>

<form action="test.php" method="POST" >
<table id="bill">
<tr>
	<th>Quantity</th>
	<th>Rate</th>
	<th>Total</th>
</tr>
<tr>
	
	<td><input type="text" id="quantity" name="quantity"/></td>
	<td><input type="text" id="rate" name="rate"/></td>
	<td><input type="text" id="total" name="total"/></td>
</tr>

<tr>
<td><input type="submit" name="submit" value="Save" ></td>
<td><button type="button" name="addrow" value="Add Row" onclick="addRow($('.bill'));">Add Row</button></td>
</tr>

</table>
</form>
Shanti C 106 Posting Virtuoso

try with this:

<?php
$mosttracks = mysql_query ("SELECT *, member_id as mem_id, name as n, COUNT(name) as cn, MIN(date_added) FROM tracks GROUP BY name ORDER BY COUNT(name) DESC, date_added asc LIMIT 3");

$number=1;
while($row = mysql_fetch_array($mosttracks))
{
echo "<tr>";
echo "<td align=left><a href=\"generic profile.php\" onclick=\"createcookie(" . $row['n'] . " )\">" . $number . ". " . $row['n'] . " (" . $row['cn'] . ")" . "</a></td>";
echo "</tr>";
$number++;
}
?>
<SCRIPT LANGUAGE="JavaScript">
function createcookie(x)
{
document.cookie = "UMAlink="+x;
}
</script>
Shanti C 106 Posting Virtuoso

check this:

while ($row = mysql_fetch_assoc($query))

{	echo 
	"<div style='border:solid 1px #cccccc; float:left; width:700px; height:150px; margin:10px;'>
			<table cellpadding='0' cellspacing='0' border='0'>
            <tr>
			<td width='200px'>
			<div>
			<a href='cars/$row[image1]' rel='lightbox' title='$row[make] $row[model]' ><img src='cars/{$row['image1']}' width='200px' height='150px'; border='0'/></a>
			</div>
			</td>
            <td valign='top' style='padding:0px 5px 0px 0px; font-size:12px; width:280px; background-color:#ffffff;'>
            <div style='text-align:left; padding:5px;'>
			  <div style='text-decoration:underline; font-size:13px; font-weight:bold;'>{$row['make']}&nbsp;{$row['model']}</div>
			  <div style='height:108px; padding-top:2px;'>{$row['description']}</div>
			  <div>Price: R.{$row['price']} | Colour: {$row['color']} | Year: {$row['yearmodel']}</div>
            </div>
			
            </td>
            <td width='120px'>";

if($row["image1"]!="")
$image1=$row["image1"];
else
$images1="../no_im_found.jpg";// your image with path.
if($row["image2"]!="")
$image2=$row["image2"];
else
$images2="../no_im_found.jpg";// your image with path.
if($row["image3"]!="")
$image3=$row["image3"];
else
$images3="../no_im_found.jpg";// your image with path.
echo "<!-- here i need to first check if the variable $image2 contains an image other was its shows that icon of no image found -->
            <img src='cars/$image2' width='120px' height='90px'; border='0'/>
            </td> 
            <td width='120px'>
<!-- here i need to first check if the variable $image3 contains an image other was its shows that icon of no image found -->
            <img src='cars/$image2' width='120px' height='90px'; border='0'/>
            </td>
            </tr>
            </table>
	</div>"; 
}
Shanti C 106 Posting Virtuoso

then mark this thread as solved.

Shanti C 106 Posting Virtuoso

i have some work now, please check this small issue yourself, it is not much difficult to do. Its a just our login mistake.
Whenever i got time, then i will work on this.
Sorry and thanks.

Shanti C 106 Posting Virtuoso

again try with this:

<!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=iso-8859-1" />
<title>PACKING GUIDE</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:601px;
top:157px;
width:81px;
height:22px;
}
#Layer2 {
position:absolute;
left:84px;
top:458px;
width:62px;
height:13px;
z-index:1;
}
.style4 {font-family: Tahoma; font-size: 9px; }
.style5 {font-size: 9px}
.style7 {font-family: Tahoma}
#Layer3 {
position:absolute;
left:88px;
top:346px;
width:80px;
height:17px;
z-index:1;
}
.style8 {
font-size: 7px;
font-weight: bold;
}
#Layer4 {
position:absolute;
left:35px;
top:137px;
width:103px;
height:16px;
z-index:2;
}
.style16 {font-family: Tahoma; font-size: 8px; }
.style17 {font-size: 8px}
.style18 {font-family: Tahoma; font-size: 8px; font-weight: bold; }
.style19 {font-family: Tahoma; font-size: 8px; color: #FFFFFF; }
-->
</style>
</head>

<body>
<?php packing_guide(); ?>
<?php packing_guide_detail(); ?>
<?php total_pg(); ?>
</body>
</html>
<?php
function packing_guide()
{
include("db_PSIS.php");
$sql="SELECT tblPackingGuide.SANo,
tblPackingGuide.DeptID,
tblPackingGuide.DevCategory,
tblPackingGuide.PONo,
tblPackingGuide.PackingCategory,
tblPackingGuide.DateEncoded,
tblPackingGuide.TimeEncoded,
tblPackingGuide.ShipmentDate,
tblPackingGuide.Status,
tblDepartment.DepartmentName
FROM tblDepartment
INNER JOIN (tblDetails INNER JOIN tblPackingGuide ON tblDetails.SANo = tblPackingGuide.SANo) ON tblDepartment.DepartmentID = tblPackingGuide.DeptID
WHERE tblPackingGuide.SANO = (SELECT SANo FROM tblSANo_print)
ORDER BY tblDetails.MasterBoxNo, tblDetails.InnerBoxNo, tblDetails.NoOfLots";
$res=mysql_query($sql);
$rec=mysql_num_rows($res);
$row=mysql_fetch_array($res);
?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center"><h2><b>AMERTRON INCORPORATED</h2></b>PACKING GUIDE</td>
</tr>
<tr>
<td align="center"><b><?php print $row["DepartmentName"] ?></b></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td>SA Number:</td>
<td><?php print $row["SANo"] ?></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Device Category:</td>
<td><?php print $row["DevCategory"] ?></td>
</tr>
<tr>
<td>Shipment Date:</td>
<td><?php print $row["ShipmentDate"] ?></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Shipment Category:</td>
<td><?php print $row["PackingCategory"] ?></td>
</tr>
<tr>
<td>PO Number:</td>
<td><?php print $row["PONo"] ?></td>
<td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<br>
<?php
}

function packing_guide_detail()
{
include("db_PSIS.php");
$sql_det="SELECT pg1.MasterBoxNo,
pg1.InnerBoxNo, …
Shanti C 106 Posting Virtuoso

try with this:

<!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=iso-8859-1" />
<title>PACKING GUIDE</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:601px;
top:157px;
width:81px;
height:22px;
}
#Layer2 {
position:absolute;
left:84px;
top:458px;
width:62px;
height:13px;
z-index:1;
}
.style4 {font-family: Tahoma; font-size: 9px; }
.style5 {font-size: 9px}
.style7 {font-family: Tahoma}
#Layer3 {
position:absolute;
left:88px;
top:346px;
width:80px;
height:17px;
z-index:1;
}
.style8 {
font-size: 7px;
font-weight: bold;
}
#Layer4 {
position:absolute;
left:35px;
top:137px;
width:103px;
height:16px;
z-index:2;
}
.style16 {font-family: Tahoma; font-size: 8px; }
.style17 {font-size: 8px}
.style18 {font-family: Tahoma; font-size: 8px; font-weight: bold; }
.style19 {font-family: Tahoma; font-size: 8px; color: #FFFFFF; }
-->
</style>
</head>

<body>
<?php packing_guide(); ?>
<?php packing_guide_detail(); ?>
<?php total_pg(); ?>
</body>
</html>
<?php
function packing_guide()
{
include("db_PSIS.php");
$sql="SELECT tblPackingGuide.SANo,
tblPackingGuide.DeptID,
tblPackingGuide.DevCategory,
tblPackingGuide.PONo,
tblPackingGuide.PackingCategory,
tblPackingGuide.DateEncoded,
tblPackingGuide.TimeEncoded,
tblPackingGuide.ShipmentDate,
tblPackingGuide.Status,
tblDepartment.DepartmentName
FROM tblDepartment
INNER JOIN (tblDetails INNER JOIN tblPackingGuide ON tblDetails.SANo = tblPackingGuide.SANo) ON tblDepartment.DepartmentID = tblPackingGuide.DeptID
WHERE tblPackingGuide.SANO = (SELECT SANo FROM tblSANo_print)
ORDER BY tblDetails.MasterBoxNo, tblDetails.InnerBoxNo, tblDetails.NoOfLots";
$res=mysql_query($sql);
$rec=mysql_num_rows($res);
$row=mysql_fetch_array($res);
?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center"><h2><b>AMERTRON INCORPORATED</h2></b>PACKING GUIDE</td>
</tr>
<tr>
<td align="center"><b><?php print $row["DepartmentName"] ?></b></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td>SA Number:</td>
<td><?php print $row["SANo"] ?></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Device Category:</td>
<td><?php print $row["DevCategory"] ?></td>
</tr>
<tr>
<td>Shipment Date:</td>
<td><?php print $row["ShipmentDate"] ?></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Shipment Category:</td>
<td><?php print $row["PackingCategory"] ?></td>
</tr>
<tr>
<td>PO Number:</td>
<td><?php print $row["PONo"] ?></td>
<td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<br>
<?php
}

function packing_guide_detail()
{
include("db_PSIS.php");
$sql_det="SELECT pg1.MasterBoxNo,
pg1.InnerBoxNo,
pg1.LotNo, …
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

here is the database

??????

Shanti C 106 Posting Virtuoso

post your database tables with data. (as .sql file)
and also try with modified 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=iso-8859-1" />
<title>PACKING GUIDE</title>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:601px;
	top:157px;
	width:81px;
	height:22px;
}
#Layer2 {
	position:absolute;
	left:84px;
	top:458px;
	width:62px;
	height:13px;
	z-index:1;
}
.style4 {font-family: Tahoma; font-size: 9px; }
.style5 {font-size: 9px}
.style7 {font-family: Tahoma}
#Layer3 {
	position:absolute;
	left:88px;
	top:346px;
	width:80px;
	height:17px;
	z-index:1;
}
.style8 {
	font-size: 7px;
	font-weight: bold;
}
#Layer4 {
	position:absolute;
	left:35px;
	top:137px;
	width:103px;
	height:16px;
	z-index:2;
}
.style16 {font-family: Tahoma; font-size: 8px; }
.style17 {font-size: 8px}
.style18 {font-family: Tahoma; font-size: 8px; font-weight: bold; }
.style19 {font-family: Tahoma; font-size: 8px; color: #FFFFFF; }
-->
</style>
</head>

<body>
<?php packing_guide(); ?>
<?php packing_guide_detail(); ?>
<?php total_pg(); ?>
</body>
</html>
<?php 
function packing_guide()
{
	include("db_PSIS.php");
	$sql="SELECT tblPackingGuide.SANo, 
			tblPackingGuide.DeptID, 
			tblPackingGuide.DevCategory, 
			tblPackingGuide.PONo, 
			tblPackingGuide.PackingCategory, 
			tblPackingGuide.DateEncoded, 
			tblPackingGuide.TimeEncoded, 
			tblPackingGuide.ShipmentDate, 
			tblPackingGuide.Status, 
			tblDepartment.DepartmentName
		FROM tblDepartment 
			INNER JOIN (tblDetails INNER JOIN tblPackingGuide ON tblDetails.SANo = tblPackingGuide.SANo) ON tblDepartment.DepartmentID = tblPackingGuide.DeptID
		WHERE tblPackingGuide.SANO = (SELECT SANo FROM tblSANo_print)
		ORDER BY tblDetails.MasterBoxNo, tblDetails.InnerBoxNo, tblDetails.NoOfLots";
	$res=mysql_query($sql);
	$rec=mysql_num_rows($res);
	$row=mysql_fetch_array($res);
?>
	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr>
		<td align="center"><h2><b>AMERTRON INCORPORATED</h2></b>PACKING GUIDE</td>
		</tr>
		<tr>
		<td align="center"><b><?php print $row["DepartmentName"] ?></b></td>
		</tr>
	</table>
	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr>
		<td>SA Number:</td>
		<td><?php print $row["SANo"] ?></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td>Device Category:</td>
		<td><?php print $row["DevCategory"] ?></td>
		</tr>
		<tr>
		<td>Shipment Date:</td>
		<td><?php print $row["ShipmentDate"] ?></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td>Shipment Category:</td>
		<td><?php print $row["PackingCategory"] ?></td>
		</tr>
		<tr>
		<td>PO Number:</td>
		<td><?php print $row["PONo"] ?></td>
		<td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> …
Shanti C 106 Posting Virtuoso

or tel me if this is working or not:

<!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=iso-8859-1" />
<title>PACKING GUIDE</title>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:601px;
	top:157px;
	width:81px;
	height:22px;
}
#Layer2 {
	position:absolute;
	left:84px;
	top:458px;
	width:62px;
	height:13px;
	z-index:1;
}
.style4 {font-family: Tahoma; font-size: 9px; }
.style5 {font-size: 9px}
.style7 {font-family: Tahoma}
#Layer3 {
	position:absolute;
	left:88px;
	top:346px;
	width:80px;
	height:17px;
	z-index:1;
}
.style8 {
	font-size: 7px;
	font-weight: bold;
}
#Layer4 {
	position:absolute;
	left:35px;
	top:137px;
	width:103px;
	height:16px;
	z-index:2;
}
.style16 {font-family: Tahoma; font-size: 8px; }
.style17 {font-size: 8px}
.style18 {font-family: Tahoma; font-size: 8px; font-weight: bold; }
.style19 {font-family: Tahoma; font-size: 8px; color: #FFFFFF; }
-->
</style>
</head>

<body>
<?php packing_guide(); ?>
<?php packing_guide_detail(); ?>
<?php total_pg(); ?>
</body>
</html>
<?php 
function packing_guide()
{
	include("db_PSIS.php");
	$sql="SELECT tblPackingGuide.SANo, 
			tblPackingGuide.DeptID, 
			tblPackingGuide.DevCategory, 
			tblPackingGuide.PONo, 
			tblPackingGuide.PackingCategory, 
			tblPackingGuide.DateEncoded, 
			tblPackingGuide.TimeEncoded, 
			tblPackingGuide.ShipmentDate, 
			tblPackingGuide.Status, 
			tblDepartment.DepartmentName
		FROM tblDepartment 
			INNER JOIN (tblDetails INNER JOIN tblPackingGuide ON tblDetails.SANo = tblPackingGuide.SANo) ON tblDepartment.DepartmentID = tblPackingGuide.DeptID
		WHERE tblPackingGuide.SANO = (SELECT SANo FROM tblSANo_print)
		ORDER BY tblDetails.MasterBoxNo, tblDetails.InnerBoxNo, tblDetails.NoOfLots";
	$res=mysql_query($sql);
	$rec=mysql_num_rows($res);
	$row=mysql_fetch_array($res);
?>
	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr>
		<td align="center"><h2><b>AMERTRON INCORPORATED</h2></b>PACKING GUIDE</td>
		</tr>
		<tr>
		<td align="center"><b><?php print $row["DepartmentName"] ?></b></td>
		</tr>
	</table>
	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr>
		<td>SA Number:</td>
		<td><?php print $row["SANo"] ?></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td>Device Category:</td>
		<td><?php print $row["DevCategory"] ?></td>
		</tr>
		<tr>
		<td>Shipment Date:</td>
		<td><?php print $row["ShipmentDate"] ?></td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td>Shipment Category:</td>
		<td><?php print $row["PackingCategory"] ?></td>
		</tr>
		<tr>
		<td>PO Number:</td>
		<td><?php print $row["PONo"] ?></td>
		<td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		</tr>
	</table>
	<br>
<?php
}

function packing_guide_detail() …
Shanti C 106 Posting Virtuoso

yes, you just post required tables with data.

Shanti C 106 Posting Virtuoso

yes,do something for me,
please point out the line which you think your logic goes wrong in that attached file?