RE: [PHP-DB] help with $_Get in form
| From: | Matt Babineau | Date: | Fri, 21 Jun 2002 18:28:51 +0000 |
| Subject: | RE: [PHP-DB] help with $_Get in form | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19981@lists.php.net to get a copy of this message | ||
Just from quickly looking you are trying to submit a form and grab the
submitted value and stick it into the DB?
If so try using METHOD="POST" on your form, and using the variable
$_POST["form_field"] in the insert statement
Matt Babineau
MCWD / CCFD
-----------------------------------------
e: matt@criticalcode.com
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
-----Original Message-----
From: Mike Germain [mailto:mike.germain@zinsser.com]
Sent: Friday, June 21, 2002 2:25 PM
To: php-db@lists.php.net
Subject: [PHP-DB] help with $_Get in form
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>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php