PHP passing data using form -
i have form passes data index.php update.php. code passed date of birth variable didn't pass $leadid variable. wrong code?
part of code in index.php
<form method="post" action="update.php"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">lead id</td> <td> <?php mysql_connect('localhost', 'root', ''); mysql_select_db('test'); $sql = "select leadid table lead_no ='$lead_no'"; $result = mysql_query($sql); $row = mysql_fetch_row($result); $leadid = $row[0]; echo $leadid; ?> </td> </tr> <tr> <td width="100">date of birth</td> <td><input name="birth" type="date" id="birth"></td> </tr> </table> </form>
in update.php have post
$id = $_post['leadid']; $birth = $_post['birth'];
in code there no input field leadid variable. try adding hidden field this:
<input type="hidden" value="<?php echo $leadid;?>" name="leadid" />
then, post variable should transferred.
Comments
Post a Comment