Jump to content

input hidden


anser316

Recommended Posts

while($row = mysql_fetch_array( $result2 )) {
echo "<tr><td>";
echo $row['presc_id'];
echo "</a>";
echo "</td><td>";
echo $row['presc_date'];
echo "</td><td>";
echo $row['exemption_type'];
echo "</td><td>";
echo $row['branch_id'];
echo "</td></tr>"; 
}
echo "</table>";

echo"<form action=purchase.php method=post>";
echo "<p align=right>";
echo "<table border=1>";
echo "<tr>";
echo "<td>Search Drug Name </TD>";
echo "<td><input type=text name=drugname></TD>";
echo "<input type='hidden' name=presc_id value='$row['presc_id']'>";  //LINE 76
echo "</tr>";
echo "</table>";
echo "<input type =submit name='searchdrug' value= Search>";
echo "<input type = reset>";
echo "</form>";
}[code]

 

I added line 76 to a working code, and got this error

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\project\branch1\SalesAssistant\purchase.php on line 76[/code]

Link to comment
https://forums.phpfreaks.com/topic/101695-input-hidden/
Share on other sites

thanks it works, but when i try this

$dname = $_POST[drugname];
print $dname;
$presc=$_POST[presc_id];
echo "presc:";
echo $presc;

the dname works, but not the presc, and the presc is definetly getting a value, because where i showed before:

echo $row['presc_id'];

displayed a number

Link to comment
https://forums.phpfreaks.com/topic/101695-input-hidden/#findComment-520320
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.