I have 3 files. Edit_del_bank.htm->edit_del.php->edit_bank.php file I want to send ‘bank’ listbox value from edit_del_bank.htm to edit_bank.php. But it’s not being passed. ? I have no submit button on mid file ‘edit_del.php’ how can I pass 'bank' listbox value from edit_del_bank.htm to edit_bank.php file 1) Code of edit_del.php file is – <body> <?php $n1=$_POST['bank']; echo $n1; ?> there is no php file is attached with action <form name="form1" method="post" action=""> <input type="hidden" name='bank' value="<?php echo $n1;?>"> </form> <?php if(isset($_POST['EDIT'])) { header ("location:edit_bank.php"); } ?> </body> 2) code of edit_bank.php file is – <body> <?php $con = mysql_connect("localhost","sanganak_manish","manish"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("sanganak_mydata",$con); echo "hello"; echo $_POST['bank']; $result = mysql_query("SELECT * FROM bank where name ='" . $_POST[bank] . "'"); ?> <form name="form1" method="post" action="update_bank.php"> <p>name: <input type="text" name="name" value="<?php echo $row['name']; ?>"> </p> <p> <select name="category" value="<?php echo $row['category'];?>"> </select> </p> <p>Toll_Free_Number: <input type="text" name="toll_free_number" value="<?php echo $row['toll_free_number']; ?>"> </p> <p><br> <input type="submit" name="Submit" value="Submit"> <?php mysql_close($con); ?> </p> </form> </body> Please help me to do this.
You have many options: 1. have them in hidden fields in second form. 2. Save them in database after first page is submitted and keep on adding the rest as they are submitted, 3. Save them in sessions and clear when you add it to db finally. This is simple task, I am not giving any sample code.
<form name="form1" method="post" action=""> The action is blank.. So when you press submit it goes where? I would _get the information and put it into a hidden field and pass it on to the next invisibly.
I would recommend you to pass them on in either a hidden form or by SESSION. If you save them in a database, you give the database extra work.
I am calling edit.php file through header ("location:edit_bank.php"); can't I pass 'bank' variable value to edit.php without using action.
You should try something like this then: header("location:edit_bank.php&bank=$bank"); and then on the bank_edit.php page you could get the variable: <?php $bank = $_GET['bank']; ?>