Need help fixing my Accident Report

I am having problems getting my forms to show all I get is the " Incident Report

Your Accident Report has now been submitted, it has gone for manual review by one of the staff team. This process can take up to 24 hours."

I cant figure out why it will not get past the PHP scrip. Can you help me?
Thank you

<?php
	ob_start();
	require('extra/header.php');

    if(empty($_SESSION['userid']) || !isset($_SESSION['userid'])) 
    { 
        header("Location: login.php"); 
        exit;
    } 
	$userid = intval($_SESSION['userid']);
	if(!$userClass->checkUserVerified($userid)){
		echo '<div class="container"><h2>Incident Report</h2></div>';
		exit;
	}	
		
		$query = " 
			INSERT INTO accident ( 
				location, 
				tow, 
				cost,
				truck,
				trailer,
				description,
				driver
				
			) VALUES ( 
				:location, 
				:tow, 
				:cost,
				:truck,
				:trailer,
				:description,
				:driver
			) 
		"; 

		$query_params = array(  
			':location' => $location,
			':tow' => $tow,
			':cost' => $cost,
			':truck' => $truck,
			':trailer' => $trailer,
			':description' => $description,
			':driver' => $userid
		); 

		try 
		{ 
			$stmt = $db->prepare($query); 
			$result = $stmt->execute($query_params); 
		} 
		catch(PDOException $ex) 
		{ 
			die("Failed to run query: " . $ex->getMessage()); 
		} 
		echo '<div class="container"><h2>Incident Report</h2>
		<p>Your Accident Report has now been submitted, it has gone for manual review by one of the staff team. This process can take up to 24 hours.</div>';
		exit;


    	?> <div class="main">
		<div class="container" style="width:450px;">
			  <form class="form-signin" role="form" action="submitjob.php" method="post">
				<h2 class="form-signin-heading">Accident Report</h2><br />
               Username:<br />
                <input name="username" class="form-control" value="<?php echo $userClass->getUserUsername($_SESSION['userid']); ?>" disabled><br />
					
				Where did the Accident Happen:<br />
				<input type="text" name="location" class="form-control" min="0" required><br />			
				Tow Cost:<br />
				<input type="number" name="tow" class="form-control" min="0" ><br />			
				Cost of Repair:<br />
				<input type="number" name="cost" class="form-control" min="0" required><br />
               Truck Damage Percentage:<br />
				<input type="number" name="truck" class="form-control" min="0" required><br />
               Trailer Damage Percentage:<br />
				<input type="number" name="trailer" class="form-control" min="0" required><br />
                
				<p>Description of Incident:</p><br />
                <textarea name="description"></textarea><br />
                <button class="btn btn-lg btn-primary btn-block" type="submit"><?php echo $lang['general_submit']; ?></button>
			  </form><br /><br />
		</div></div>
<?php require('extra/footer.php'); ?>

Where do your array variables magically come from?

I fixed that

$query_params = array(
‘:location’ => $_POST[‘location’],
‘:tow’ => $_POST[‘tow’],
‘:cost’ => $_POST[‘cost’],
‘:truck’ => $_POST[‘truck’],
‘:trailer’ => $_POST[‘trailer’],
‘:description’ => $_POST[‘description’],
‘:driver’ => $userid
);

Sponsor our Newsletter | Privacy Policy | Terms of Service