Use ORA to enter data into data table ' Email_info '
When the user browses the script, a form consisting of the name and email input field is displayed, and when the user clicks Submit, the script will save the name and email to the ' email_info ' data sheet.
Related PHP Code:
if ($submit = = "click") {
The Submit button was clicked!
Get the input for FullName and e-mail then store it in the database.
PUTENV ("Oracle_sid=orasid");
$connection = Ora_logon ("username", "password");
if ($connection = = False) {
echo Ora_errorcode ($connection). ":". Ora_error ($connection). "
";
Exit
}
$cursor = Ora_open ($connection);
if ($cursor = = False) {
echo Ora_errorcode ($connection). ":". Ora_error ($connection). "
";
Exit
}
$query = "INSERT into email_info values (' $fullname ', ' $email ')";
$result = Ora_parse ($cursor, $query);
if ($result = = False) {
echo Ora_errorcode ($cursor). ":". Ora_error ($cursor). "
";
Exit
}
$result = Ora_exec ($cursor);
if ($result = = False) {
echo Ora_errorcode ($cursor). ":". Ora_error ($cursor). "
";
Exit
}
Ora_commit ($connection);
Ora_close ($cursor);
Ora_logoff ($connection);
}
else{
Echo '
<form action=insert.php method=post>
Please enter your name
<input name=fullname> </INPUT>
Please enter an email address
<input name=email> </INPUT>
<input name=submit type=submit value=click> </INPUT>
</FORM>
';
}
?>
Yes, this script must be saved as insert.php, because specifying insert.php as the form handler in the called page
http://www.bkjia.com/PHPjc/315644.html www.bkjia.com true http://www.bkjia.com/PHPjc/315644.html techarticle use ORA to enter data into data table ' Email_info ' when the user browses the script, a form consisting of the name and email input field is displayed, and when the user clicks Submit, the script ...