Forum Moderators: coopster
<form name=\"AccessInterface\" action=\"process.php\" method=post>
DoctorsID:<input name=\"DoctorsID\" type=\"text\" size=\"25\" ><br>
Organization:<input name=\"Organization\" type=\"text\" size=\"25\" ><br>
password:<input name=\"password\" type=\"text\" size=\"25\" ><br>
<input type=Submit value=\"insert\">
</form>
</html>
";
?>
THIS IS "PROCESS.PHP"
<html>
<?php
$cn=odbc_connect('doctordb','root',' ');
echo"connected";
if(!$cn)
Error_handler("nop connection",$cn);
$query="Select * from Table1";
$cr=odbc_exec($cn,$query);
$nbrow=0;
while( odbc_fetch_row( $cr )) {
$nbrow++;
echo"<tr><th>DoctorsID</th><th>Organization</th><th>password</th></tr>\n";
$DoctorsID=odbc_result($cr,1);
$Organization=odbc_result($cr,2);
$password=odbc_result($cr,3);
echo"<tr><td>$DoctorsID</td><td>$Organization</td><td>$password</td></tr>\n";
}
odbc_close($cn);
exit();
$cn=odbc_connect('doctordb','root',' ');
$query1="Insert into Table1 values('$DoctorsID','$Organization','$password')";
$cr1=odbc_exec($cn,$query1);
odbc_close($cn);
?>
</html>
instead of this
$query1="Insert into Table1 values('$DoctorsID','$Organization','$password')";
try it like so
$query1="Insert into Table1 values('" . $_POST['DoctorsID'] . "','" . $_POST['Organization'] . "','" . $_POST['password'] . "')";
But no row is inserted in my table..
I am trying this since long ...I dont know whats wrong here?
$query1="Insert Into People (DoctorsID, Organization, password)Values('$DoctorsID', '$Organization', '$password')";
with register_global OFF
I get an empty row inserted in my table?
with the following messages
Notice: Undefined variable: DoctorsID in c:\program files\easyphp1-8\www\process.php on line 95
Notice: Undefined variable: Organization in c:\program files\easyphp1-8\www\process.php on line 95
Notice: Undefined variable: password in c:\program files\easyphp1-8\www\process.php on line 95
please help me ..
<html>
<head>
<title>feedback form</title>
</head>
<body>
<?php
if(strlen($_POST['name']>0)){
$_POST['name']=stripslashes($_POST['name']);
}
else{
$name=NULL;
echo "<p><br>Please enter your name</br></p>";
}
if($_POST['name'] ){
echo "Thank you, <b>$name</b>";
}
?>
</body>
</html>
I get the out put as
Please enter your name
Thank you