<?php require_once 'dbutil.php'; $db = new DbUtil(); $item = $_POST['item']; $players = $_POST['sel']; $db->addGP($item, $players); if (strpos($_SERVER['HTTP_REFERER'], "?success")) { header('Location: ' . $_SERVER["HTTP_REFERER"]); } else { header('Location: ' . $_SERVER["HTTP_REFERER"] . "?success"); }