i'm newbie in php.

need more help to finish my project..i have 3 page:

1st page : status button(i'm using image button for each status and have 5 status button)
code for image button:

<a href="negeri-semak.php" ><INPUT TYPE="image" value="" src="pictures/icon/image005.gif" width="230" height="37" border="0" id="RAKAN MUDA" onclick="javascript:this.form.submit()" name="BTN" alt="RAKAN MUDA"></a>

2nd page : state button(also image button for each state and have 14 state button)

<a href="search-form.php" ><INPUT TYPE="image" value="" src="pictures/icon/image010.gif" width="230" height="37" border="0" id="MELAKA" onclick="javascript:this.form.submit()" name="BTTN" alt="MELAKA"></a>

3rd page : search form

//status and state chosen from 1st and 2nd page display on top page
<? echo $btn ?> : <? echo $bttn ?>?

//form for search data
<form enctype="multipart/form-data" action="<?=$PHP_SELF?>"  method="post">
<p><span class="style1">Sila masukkan No. Kad Pengenalan anda untuk carian maklumat.</span></p>
        <p>contoh : 880818025434</p>
        <p align="center">&nbsp;</p>
        <p align="center">
          <input name="no_ic" type="text" id="no_ic" maxlength="12" />
          <input type="submit" value="Search" name="cari" id="cari"/>
          <input type="hidden" name="BTN" value="<? echo $btn = $_POST['BTN'] ?>">
          <input type="hidden" name="BTTN" value="<? echo $bttn = $_POST['BTTN'] ?>">
        </p>
      </form>


//php code that i'm using
<?php
$btn = $_POST['BTTN'];
$bttn= $_POST['BTTN'];
$no_ic = $_POST['no_ic'];
if (isset($_POST['cari'])) 
{ 
 if(isset($_POST['no_ic']))
 $data = mysql_query("SELECT * FROM employees where no_ic='{$_POST[ 'no_ic' ]}' AND state='$bttn' AND status='$btn' LIMIT 1") or die(mysql_error()); 
  
 while($info = mysql_fetch_array( $data )) { 

//Outputs the image and other data 
echo "<table border=0 bgcolor=#006699 width=70%><tr><th><img src=images/".$info['photo'] ." alt=" . $info['photo'] . "/></th></tr>"; 
echo "<tr><td><center><table border=0 width=70%><tr><td><b>Name</b></td><td>".$info['name'] . "</td></tr>"; 
echo "<tr><td><b>Number IC</b></th><td>".$info['no_ic'] . "</td></tr>";
echo "<tr><td><b>Email</b></th><td>".$info['email'] . "</td></tr>"; 
echo "<tr><td><b>Phone</b></th><td>".$info['phone'] . " </td></tr>";
echo "<tr><td><b>Address 1</b></td><td> ".$info['address_1'] . "</td></tr> "; 
echo "<tr><td><b>Address 2</b></td><td> ".$info['address_2'] . " </td></tr>"; 
echo "<tr><td><b>Postcode</b></td><td> ".$info['postcode'] . " </td></tr>"; 
echo "<tr><td><b>State</b></td><td> ".$info['state'] . "</td></tr> "; 
echo "<tr><td><b>Status</b></td><td> ".$info['status'] . "</td></tr></center></table></td></tr></table>"; 

$infodata = mysql_num_rows($data);
}

}
  

if ($no_ic == ''){
		echo "<font color='red'>SILA PASTIKAN ANDA MASUKKAN NOMBOR KAD PENGENALAN YANG SAH!";
		} else
		if ($infodata == 0){
		echo "<font color='red'>MAAF, MAKLUMAT YANG DICARI TIADA DALAM PANGKALAN DATA KAMI!";
		}
?>

**MY PROBLEM**

when i use gray button inside dreamweaver it work properly. but when i'm using image button the value for each button did not passing to next page. how can i make my button passing value to next page?i want use every choise from page 1 and 2 to work with my select statement.

//SELECT * FROM employees where no_ic='{$_POST[ 'no_ic' ]}' AND state='$bttn' AND status='$btn';

can anyone help me...? thanks 4 the help.

You know about <input type="hidden">, since you are using it. You need to use it on the second page to pass the (now hidden) value from the first page along to the third page.

You also have an extra 'T' on line 21.

You know about <input type="hidden">, since you are using it. You need to use it on the second page to pass the (now hidden) value from the first page along to the third page.

You also have an extra 'T' on line 21.

thanks 4 info. i already delete that extra T but still cant solve my problem. its still not passing the value. yes i didd used <input type="hidden"> in each of my page, but still not work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.