I have a PHP page in which I display an HTML form, once the form is ready to be submitted, I want to upload it into an Oracle database using the PHP section of the page, which I've included below.
However, I'm not sure what I'm doing incorrectly, I check the database and I am not getting any data loaded on, but I am also not getting any errors on the screen.
Can anyone help me by showing me how to properly upload HTML form data to an Oracle DB using PHP?
Can somebody point out what would cause my code to not work?
Thank you.
<?php
require_once ("xmlrpc.inc");
require_once ("globals.php");
class form
{
public static function run()
{
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
$conn = oci_connect("username", "password", "path/to");
if (!$conn)
{
$m = oci_error();
echo $m['message'], "
";
exit;
}
else
{
//print "You are connected to the VTC database!<br/>";
}
$issueType = $_POST['issueType'];
$summary = $_POST['summary'];
$endPointName = $_POST['endPointName'];
$contactFirstName = $_POST['contactFirstName'];
$contactLastName = $_POST['contactLastName'];
$contactEmail = $_POST['contactEmail'];
$contactPhone = $_POST['contactPhone'];
$description = $_POST['description'];
$solution = $_POST['solution'];
$ticketNumber = $_POST['ticketNumber'];
$resolved = $_POST['resolved'];
$agency = $_POST['agency'];
$insert = 'INSERT INTO VTC_HELPDESK_ISSUES(ISSUE_TYPE,ISSUE_SHORT,ENDPOINT_NAME,CONTACT_FIRST_NAME,CONTACT_LAST_NAME,CONTACT_EMAIL,CONTACT_PHONE,ISSUE_DESC,SOLUTION,OTHER_COMPANY_TICKET_NUM,RESOLVED,AGENCY) '.
'VALUES(:issueType, :summary, :endPointName, :contactFirstName, :contactLastName, :contactEmail, :contactPhone, :description, :solution, :ticketNumber, :resolved, :agency)';
$send = oci_parse($conn, $insert);
//Binding makes it harder to submit anything directly to the Oracle DB
oci_bind_by_name($send, ':issueType', $issueType);
oci_bind_by_name($send, ':summary', $summary);
oci_bind_by_name($send, ':endPointName', $endPointName);
oci_bind_by_name($send, ':contactFirstName', $contactFirstName);
oci_bind_by_name($send, ':contactLastName', $contactLastName);
oci_bind_by_name($send, ':contactEmail', $contactEmail);
oci_bind_by_name($send, ':contactPhone', $contactPhone);
oci_bind_by_name($send, ':description', $description);
oci_bind_by_name($send, ':solution', $solution);
oci_bind_by_name($send, ':ticketNumber', $ticketNumber);
oci_bind_by_name($send, ':resolved', $resolved);
oci_bind_by_name($send, ':agency', $agency);
oci_execute($send);
}
}
?>