Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //POST-DATA
- $A_ID = mysql_real_escape_string($_POST['A_ID']);
- $row = mysql_real_escape_string($_POST['row']);
- $year = mysql_real_escape_string($_POST['year']);
- $quality = mysql_real_escape_string($_POST['quality']);
- $value = mysql_real_escape_string($_POST['value']);
- $type = mysql_real_escape_string($_POST['type']);
- $country = mysql_real_escape_string($_POST['country']);
- $notes = mysql_real_escape_string($_POST['notes']);
- $is_roll = mysql_real_escape_string($_POST['is_roll']);
- $action = mysql_real_escape_string($_REQUEST['do']);
- switch($action){
- case "add":
- //Check for requiered values
- if ($A_ID == '' || $row == '' || $year == '' || $quality == '' || $value == '' || $type == '' || $country == '---') {
- header('Location: /insert.php?do=fail');
- break;
- }
- include ('db_connect.php');
- $query = "INSERT INTO `coin_bases` (`id`, `A_ID`, `row`, `year`, `quality`, `value`, `type`, `country`, `notes`)
- VALUES (NULL,'$A_ID','$row','$year','$quality','$value','$type', '$country', '$notes')";
- mysql_query($query);
- mysql_close();
- header('Location: /insert.php?do=success');
- break;
- case "addroll":
- //Check for requiered values
- if ($A_ID == '' || $year == '' || $quality == '' || $value == '' || $type == '' || $country == '---') {
- header('Location: /insert.php?do=fail#tab2');
- break;
- }
- include ('db_connect.php');
- $query = "INSERT INTO `coin_bases` (`id`, `A_ID`, `year`, `quality`, `value`, `type`, `country`, `notes`, `is_roll`)
- VALUES (NULL, '$A_ID', '$year','$quality','$value', '$type', '$country', '$notes', '$is_roll')";
- mysql_query($query);
- mysql_close();
- header('Location: /insert.php?do=success_roll#tab2');
- break;
- }
- exit;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment