Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- // This function will run within each post array including multi-dimensional arrays
- function ExtendedAddslash(&$params)
- {
- foreach ($params as &$var) {
- // check if $var is an array. If yes, it will start another ExtendedAddslash() function to loop to each key inside.
- is_array($var) ? ExtendedAddslash($var) : $var=addslashes($var);
- unset($var);
- }
- }
- // Initialize ExtendedAddslash() function for every $_POST variable
- ExtendedAddslash($_POST);
- $submission_id = $_POST['submission_id'];
- $ticketid = $_POST['ticketNo'];
- $region = $_POST['region30'];
- $companycode = $_POST['companycode'];
- $companyname = $_POST['companyname'];
- $customername = $_POST['customername'];
- $phonenumber = $_POST['phonenumber'];
- $email = $_POST['email5'];
- $suitabletime = $_POST['suitabletime20'];
- $teamviewerid = $_POST['teamviewerid'];
- $teamviewerPas = $_POST['teamviewerpassword'];
- $uploadError = $_POST['uploaderror'];
- $describeThe = $_POST['describethe'];
- $describeproblemvoice = $_POST['describeproblem'];
- $location = $_POST['clickto27'];
- $code = $_POST['code'];
- $ticketStatus = $_POST['ticketstatus'];
- $answerDate = $_POST['answerdate'];
- $confirmationCode = $_POST['confirmationcode'];
- $closedBy = $_POST['closedby'];
- $answerBy = $_POST['answerby'];
- $monetaryTerm = $_POST['monetaryterm'];
- $modeOf = $_POST['modeof'];
- $supportCharges = $_POST['supportcharges'];
- $solutionProvided = $_POST['solutionprovided'];
- $uploadSupporting = $_POST['uploadsupporting'];
- $closingDate = $_POST['closingdate'];
- $responsetime = $_POST['responsetime'];
- $pageurl = $_POST['typea'];
- $db_host = 'localhost';
- $db_username = 'Your Username';
- $db_password = 'Your Password';
- $db_name = 'Your Database';
- mysql_connect( $db_host, $db_username, $db_password) or die(mysql_error());
- mysql_select_db($db_name);
- // search submission ID
- $query = "SELECT * FROM Cloneof3DSystemsOpenTicket WHERE `submission_id` = '$submission_id'";
- $sqlsearch = mysql_query($query);
- $resultcount = mysql_num_rows($sqlsearch);
- if ($resultcount > 0) {
- mysql_query("UPDATE `Cloneof3DSystemsOpenTicket` SET `submissionID` = '$submission_id',`TicketNo` = '$ticketid',`Region` = '$region',`CompanyCode` = '$companycode',`CompanyName` = '$companyname',`CustomerName` = '$customername',`PhoneNumber` = '$phonenumber',`Email` = '$email',`Suitabletimetocontactorremote` = '$suitabletime',`TeamviewerID` = '$teamviewerid',`TeamviewerPassword` = '$teamviewerPas',`UploadErrorScreenShot` = '$uploadError',`DescribetheProblem` = '$describeThe',`DescribeProblemvoice` = '$describeproblemvoice',`DetectedLocation` = '$location',`Code` = '$code',`TicketStatus` = '$ticketStatus',`AnswerDate` = '$answerDate',`ConfirmationCode` = '$confirmationCode',`ClosedBy` = '$closedBy',`AnswerBy` = '$answerBy',`MonetaryTerm` = '$monetaryTerm ',`ModeOfpayment` = '$modeOf',`SupportCharges` = '$supportCharges',`SolutionProvided` = '$solutionProvided',`UploadSupportingdocument` = '$uploadSupporting',`ClosingDate` = '$closingDate',`ResponsetimeDays` = '$responsetime',`GetPageURL` = '$pageurl' WHERE `submission_id` = '$submission_id'")
- or die(mysql_error());
- } else {
- mysql_query("INSERT INTO `Cloneof3DSystemsOpenTicket` (`submissionID`,`TicketNo`,`Region`,`CompanyCode`,`CompanyName`,`CustomerName`,`PhoneNumber`,`Email`,`Suitabletimetocontactorremote`,`TeamviewerID`,`TeamviewerPassword`,`UploadErrorScreenShot`,`DescribetheProblem`,`DescribeProblemvoice`,`DetectedLocation`,`Code`,`TicketStatus`,`AnswerDate`,`ConfirmationCode`,`ClosedBy`,`AnswerBy`,`MonetaryTerm`,`ModeOfpayment`,`SupportCharges`,`SolutionProvided`,`UploadSupportingdocument`,`ClosingDate`,`ResponsetimeDays`,`GetPageURL`) VALUES ( '$submission_id', '$ticketid', '$region', '$companycode', '$companyname', '$customername', '$phonenumber', '$email', '$suitabletime', '$teamviewerid', '$teamviewerPas', '$uploadError', '$describeThe', '$describeproblemvoice', '$location', '$code', '$ticketStatus', '$answerDate', '$confirmationCode', '$closedBy', '$answerBy', '$monetaryTerm ', '$modeOf', '$supportCharges', '$solutionProvided', '$uploadSupporting', '$closingDate', '$responsetime', '$pageurl') ")
- or die(mysql_error());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement