i have two select boxes in my form named month and year...when i selected these two things, there is a submit button called 'generate invoice'. when i click this, invoice report is generated as a table on the same page and i put customer number and block number in the hidden field in this step.....i have another link called 'payment' in the generated table for each row...when i click that link the form gets once again submitted....but, when i am going to retrieve the hidden field data(customer number and block number) i couldn't get that data...why? my code is here
plz solve this problem... -
-
<?php
-
require_once('database_conn.php');
-
session_start();
-
if(isset($_SESSION['username']))
-
{
-
?>
-
<html>
-
<head>
-
<title>Property Management System</title>
-
<style>
-
.edit
-
{
-
text-decoration:underline;
-
cursor:pointer;
-
color:blue;
-
}
-
</style>
-
<script type="text/javascript">
-
function month_display()
-
{
-
if(document.getElementById('billmonth').value=="nil")
-
{
-
alert("Please Select Month");
-
}
-
-
}
-
function year_display()
-
{
-
if(document.getElementById('billyear').value==0)
-
{
-
alert("Please Select Year");
-
}
-
}
-
function payment()
-
{
-
document.forms[0].submit();
-
}
-
function validate()
-
{
-
var error="";
-
if(document.getElementById('billmonth').value=="nil")
-
{
-
error +="Please Select Month\n";
-
}
-
if(document.getElementById('billyear').value==0)
-
{
-
error +="Please Select Year\n";
-
}
-
if(error)
-
{
-
alert(error);
-
return false;
-
}
-
else
-
{
-
return true;
-
}
-
}
-
</script>
-
</head>
-
<body>
-
<?php
-
include('adminlogin.php');
-
?>
-
<form action="bill_index.php" method="post" name="cust" onsubmit="javascript:return validate();">
-
<?php
-
if (isset($_POST['custno']))
-
{
-
$custno=$_POST['custno'];
-
echo $custno;
-
}
-
else
-
{
-
?>
-
<table border="0" align="center" cellspacing="1" cellpadding="2" class="bg1">
-
<div style="position:absolute;left:600px;top:80px;"><input type="text" name="bill_date" readonly="readonly" id="bill_date" value="<?php echo date("F j, Y");?>" class="textfield" size="10" /></div>
-
<tr class="bg2"><td>Rent for the Month :</td><td>
-
<select name="billmonth" id="billmonth" class="bg2" onChange="month_display()">
-
<option value="nil">--Select--</option>
-
<?php
-
$mnth=array(1=>"Jan",2=>"Feb",3=>"Mar",
-
4=>"Apr",5=>"May",6=>"Jun",
-
7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec");
-
if(isset($_POST['billmonth']))
-
{
-
foreach($mnth as $k=>$v)
-
{
-
if($k==$_POST['billmonth'])
-
{
-
?>
-
<option value="<?php echo $k;?>" selected="selected"><?php echo $v;?></option>
-
<?php
-
}
-
else
-
{
-
?>
-
<option value="<?php echo $k;?>"><?php echo $v;?></option>
-
<?php
-
}//else
-
}//for
-
}//if
-
else
-
{
-
foreach($mnth as $k=>$v)
-
{
-
?>
-
<option value="<?php echo $k;?>"><?php echo $v;?></option>
-
<?php
-
}
-
}
-
?>
-
</select></td><td>
-
Year<select name="billyear" id="billyear" class="bg2" onchange="year_display()">
-
<option value="0">--Select--</option>
-
<?php
-
$yr=array(2007,2008,2009);
-
if(isset($_POST['billyear']))
-
{
-
for($i=0;$i<count($yr);$i++)
-
{
-
if($yr[$i]==$_POST['billyear'])
-
{
-
?>
-
<option value="<?php echo $yr[$i];?>" selected="selected"><?php echo $yr[$i];?></option>
-
<?php
-
}
-
else
-
{
-
?>
-
<option value="<?php echo $yr[$i];?>"><?php echo $yr[$i];?></option>
-
<?php
-
}//else
-
}//for
-
}//if
-
else
-
{
-
for($j=0;$j<count($yr);$j++)
-
{
-
?>
-
<option value="<?php echo $yr[$j];?>"><?php echo $yr[$j];?></option>
-
<?php
-
}
-
}
-
?>
-
</select>
-
</td></tr>
-
</table><br />
-
<center>
-
<input type="submit" name="gen_invoice" id="gen_invoice" value="Generate Invoice" class="button" /></center>
-
<br />
-
<?php
-
if(isset($_POST['billmonth']) && isset($_POST['billyear']) && isset($_POST['gen_invoice']))
-
{
-
?>
-
<table border="0" cellspacing="1" cellpadding="2" class="bg1" align="center">
-
<tr>
-
<td><div align="center">Serial No</div></td>
-
<td><div align="center">Customer Name</div></td>
-
<td><div align="center">Building Name</div></td>
-
<td><div align="center">Floor No</div></td>
-
<td><div align="center">Block Name</div></td>
-
<td><div align="center">Rent(Rs.)</div></td>
-
<td><div align="center">Payment</div></td>
-
</tr>
-
<?php
-
$flblno=mysql_query("select build_name,floor_no,block_name,pms_rental.rent,pms_rental.block_id,pms_customer.cust_name,pms_customer.cust_id from pms_block,pms_customer,pms_rental where pms_block.block_id=pms_rental.block_id and pms_rental.cust_id=pms_customer.cust_id") or die('Unable to perform the operation');
-
$cou=1;
-
while($fl=mysql_fetch_object($flblno))
-
{
-
?>
-
<tr class="bg2">
-
<td><?php echo $cou;?></td>
-
<td><?php echo $fl->cust_name;?></td>
-
<td><?php echo $fl->build_name;?></td>
-
<td><?php echo $fl->floor_no;?></td>
-
<td><?php echo $fl->block_name;?></td>
-
<td><?php echo $fl->rent;?></td>
-
<td><a href="" name="pay_link" onclick="javascript:payment();">Payment</a></td></tr>
-
<input type="hidden" name="custno" value="<?php echo $fl->cust_id;?>" />
-
<input type="hidden" name="blno" value="<?php echo $fl->block_id;?>" />
-
<?php
-
$cou++;
-
}
-
?>
-
<?php
-
}
-
?>
-
</table>
-
<?php
-
}
-
?>
-
</form>
-
</html>
-
<?php
-
}
-
-
else
-
{
-
header("location:login_index.php");
-
}
-
?>
-
-
1 1691
Do you mean that you don't get the names of the hidden fields in your $_POST array or that these fields ar in the $_POST array but have no value assigned to them?
Ronald
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Randell D. |
last post by:
Folks,
Perhaps someone can figure this out - this is 'the process of my script'
I have a form whereby I can add multiple contacts to a single address.
There is only one...
|
by: Dan R Brown |
last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to
break up this form into several "tabbed" sections, I break up the form using <div>
tags. Each <div...
|
by: Matt Herson |
last post by:
I have been trying to find a way to use JavaScript to change the value of a
hidden field on submit. I am already invoking a JavaScript to handle the
validation on submit.
The reason I need to...
|
by: Fred |
last post by:
Hi,
i know how to pass a value from Javascript to ASP with a hidden field into a
form and submitting it, or with cookies, but here i have to pass a lot of
data in an array.
There is a list of...
|
by: Itai |
last post by:
I have an aspx file named index.aspx which contains two ‘form'
sections, one that has the runat=server attribute (e.g From1) and one
which is a regular HTML form (e.g SignInForm).
I am trying...
|
by: Randell D. |
last post by:
Folks,
I have a large amount of values to store (we're talking tens, if not
hundreds of bytes). I need this for a client side application - ignore
the security consequences for the moment -...
|
by: GavMc |
last post by:
Hello I am new to internet programming and wonder if anyone can help me with
this....
I am trying to pass a hidden field value on a form into another field on the
form so that it can then be...
|
by: Ian Davies |
last post by:
Hello
I wish to use J.S. to obtain the screen ht and put this value into a hidden
field for posting. so that I can then use it in a php file.
A simplified script of what I am trying to do is...
|
by: dmorand |
last post by:
I'm having a strange issue with a form I'm developing. I'm saving some values to hidden fields when a user clicks a button. I setup a function which gets ran on submission of the form, but I also...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |