hi m facing same problem from 2,3 days i m too confused now. i m making an application. when i take data from from dont know why it doesnot reach the other page as
print_r($_POST) is empty
my code of both files are"
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("pras2");
?>
<!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">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="mm_travel2.css" type="text/css" />
<script language="JavaScript" type="text/javascript">
//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
//--------------- END LOCALIZEABLE ---------------
</script>
</head>
<body bgcolor="#C0DFFD">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#3366CC">
<td colspan="3" rowspan="2"><img src="mm_travel_photo.jpg" alt="Header image" width="382" height="127" border="0" /></td>
<td height="63" colspan="3" id="logo" valign="bottom" align="center" nowrap="nowrap">insert website name</td>
<td width="4"> </td>
</tr>
<tr bgcolor="#3366CC">
<td height="64" colspan="3" id="tagline" valign="top" align="center">OPTIONAL TAGLINE HERE</td>
<td width="4"> </td>
</tr>
<tr>
<td colspan="7" bgcolor="#003366"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#CCFF99">
<td colspan="7" id="dateformat" height="25"> <script language="JavaScript" type="text/javascript">
document.write(TODAY); </script> </td>
</tr>
<tr>
<td colspan="7" bgcolor="#003366"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td width="165" valign="top" bgcolor="#E6F3FF">
<table border="0" cellspacing="0" cellpadding="0" width="165" id="navigation">
<tr>
<td width="165"> <br />
<br /></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">destinations</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">airfare</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">cruises</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">specials</a></td>
</tr>
<tr>
<td width="165"><a href="javascript:;" class="navText">contact</a></td>
</tr>
</table>
<br />
<br />
<br />
<br /> </td>
<td width="50"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td colspan="2" valign="top"><img src="mm_spacer.gif" alt="" width="305" height="1" border="0" /><br />
<br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="650">
<tr>
<td width="650" class="pageName">welcome store officer </td>
</tr>
<tr>
<td class="bodyText"><p> </p>
<form id="form1" name="form1" method="post" action="savingISdata2.php">
<label>
Enter the date:
<input type="text" name="date" />
</label>
<p>Enter the shift num:
<label>
<input type="text" name="num" />
</label>
</p>
<p> Enter the name of the product:
<select name="P_list">'
<?php
$query="SELECT product_id,product_name FROM product";
$result = mysql_query ($query);
while($menu=mysql_fetch_assoc($result))
{
echo '<option value="'.$menu['product_name'].'">'.$menu['product_name'].'</option>';
}
?>
</select></p>
<p>Enter the amount received:
<label>
<input type="text" name="amount_rec" />
</label>
</p>
<p>Enter the sorted amount:
<label>
<input type="text" name="amount_sort" />
</label>
</p>
<p>Emter the rejected amount:
<label>
<input type="text" name="amount_rej" />
</label>
</p>
<p>Enter the reason for rejection:
<label>
<input type="text" name="reason" />
</label>
</p>
<p align="center">
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
<p> </p> </td>
</tr>
</table>
<br /> </td>
<td width="50"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td width="190" valign="top"><br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="190">
<tr>
<td colspan="3" class="subHeader" align="center">NEW DESTINATIONS</td>
</tr>
<tr>
<td width="40"><img src="mm_spacer.gif" alt="" width="40" height="1" border="0" /></td>
<td width="110" id="sidebar" class="smallText"><br />
<p><img src="mm_travel_photo1.jpg" alt="Image 1" width="110" height="110" vspace="6" border="0" /><br />
Include a short description here.<br />
<a href="javascript:;">Read more ></a></p>
<p><img src="mm_travel_photo2.jpg" alt="Image 2" width="110" height="110" vspace="6" border="0" /><br />
Include a short description here.<br />
<a href="javascript:;">Read more ></a></p>
<br />
<br />
<br /> </td>
<td width="40"> </td>
</tr>
</table> </td>
<td width="4"> </td>
</tr>
<tr>
<td width="165"> </td>
<td width="50"> </td>
<td width="167"> </td>
<td width="486"> </td>
<td width="50"> </td>
<td width="190"> </td>
<td width="4"> </td>
</tr>
</table>
</body>
</html>
<?php
?>
the file to which data goes is:
<?php
session_start();
$con=mysql_connect("localhost","root","");
mysql_select_db("pras2");
$date= $_POST['date'];
$shift_num=$_POST['num'];
$name=$_POST['P_list'];
$amount_rec=$_POST['amount_rec'];
$amount_sort=$_POST['amount_sort'];
$amount_rej =$_POST['amount_rej'];
$reason=$_POST['reason'];
$query= "SELECT * FROM `shift` WHERE date='$date' AND shift_no='$num')";
$result=mysql_query($query) or die(mysql_error());
if ($result)
{
$row=mysql_fetch_assoc($result);
$shift_id = $row(shift_id);
echo $shift_id;
}
else
{
echo "failed";
}
$query1="INSERT INTO intemediate_store (shift_id, product, quantity_sorted,quantity_rejected,quantity_received, reason_of_rejection) VALUES ('$shift_id', '$name', '$amount_sort', '$amount_rej', '$amount_rec', '$reason')";
$result1= mysql_query($query1);
if ($result1)
{
echo "data added succssfully";
}
else
{
echo "updation failed";
}
?>
the error which it gives is of undefined index of all variables