Use Ora to input data to the data table 'email _ info'
When the user browses this script, a form consisting of name and email input fields is displayed. When the user adds data and clicks to submit, the scriptProgramSave the name and email to the 'email _ info' data table.
Related PHPCode:
If ($ submit = "click "){
// The submit button was clicked!
// Get the input for fullname and email 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>
Enter name
<Input name = fullname> </input>
Enter the email address
<Input name = Email> </input>
<Input name = submit type = submit value = click> </input>
</Form>
';
}
?>
By the way, this script must be saved as insert. php, because insert. php is specified as the form processing program on the called page.