| Server IP : 172.67.201.108 / Your IP : 216.73.217.73 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/mitzvahm/planner/api/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
if ($_POST['code'] == 'autogen') :
$random_code = strval(time() - 1261440000);
$random_code = substr($random_code, 0, 3).'-'.substr($random_code, 3, 3).'-'.substr($random_code, 6);
$_POST['code'] = $random_code;
endif;
$sql = "INSERT INTO promo_codes (sku, reg_price, code, type, value, expires, limited_use, uses_left) VALUES (".
"'".mysqli_real_escape_string($GLOBALS['con'], $_POST['sku'])."'".
",".nzfloat($_POST['reg_price'], '0')." ".
",'".mysqli_real_escape_string($GLOBALS['con'], $_POST['code'])."'".
",'".mysqli_real_escape_string($GLOBALS['con'], $_POST['type'])."'".
",".nzfloat($_POST['value'], '0')." ".
",".nzdate($_POST['expires'])." ".
",".nz($_POST['limited_use'], '0')." ".
",".nz($_POST['uses_left'], '0')." )";
//echo ' === '.$sql.' === ';
if (mysqli_query($GLOBALS['con'], $sql)) :
$api_result = true;
$api_result_message = 'Success';
$ar_api_result['promo_code'] = $_POST['code'];
else :
$api_result = false;
$api_result_message = 'Database Error!';
endif;
?>