help with $_Get in form
| From: | Mike Germain | Date: | Fri, 21 Jun 2002 18:24:39 +0000 |
| Subject: | help with $_Get in form | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19980@lists.php.net to get a copy of this message | ||
I'm trying to get a partnum field into a select statement but i'm not
getting anything passed into the varable. i'm sure it's a simple fix but i
can't find it.
thx
mike
<html>
<head>
Inventory Lookup
<meta name="GENERATOR" content="W3e 2000">
<title></title>
</head>
<body>
<?php
$partnum="";
function get_partnum($partnum="") {
?>
<FORM ACTION="default.php" METHOD="get">
PartNum:<INPUT TYPE="TEXT" NAME="partnum">
<INPUT TYPE="submit" VALUE="submit">
</FORM>
<?php
}
$dsn="invfile";
$user= "";
$upasswd= "";
get_partnum();
#$partnum= $_get['partnum'];
echo $partnum;
$conn = odbc_connect($dsn,$user ,$upasswd, SQL_CUR_USE_ODBC );
echo "conn: $conn"; if ($conn <= 0) { echo "Error in connection<BR>";
exit; } else { echo "<P>Connection successful\n"; };
$query = "SELECT whs,loc,miprod,mndesc,onhand FROM npshrlib_prdinv1 where
miprod = '$partnum' ";
$result = odbc_exec($conn, $query);
odbc_result_all($result);
?>
</body>
</html>