Form help with php

A

Anonymous

Guest
change it to this, and change page.php to the name of your script. this should work.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body>

<?php

if($_POST["action"]=="update"){
echo "here";
$db = mysql_connect("localhost", "root");
mysql_select_db("phonelist",$db);
$result = mysql_query("SELECT * FROM main WHERE NAME = '".$_POST["namefield"]."'",$db);
//numfield = mysql_result($result,0,"EXTENSION");
}

?>
<p>&</p>
<form name="form1" action="page.php" method=post>
<p>Last Name <input type="text" name="namefield" size="20"><input type="submit" value="Submit" name="click">
<p>Extension <input type="text" name="numfield" size="17">
<input type="hidden" name="action" value="update"></p>
</form>

</body>

</html>
 
no <form> tag meaning your browser does not know how to encode the information you are submitting. If you use Iceman's example it should work granted you output the query result out to the browser.
 
Back
Top