Okay i have a code for Add and i can put the details in but after i click on Add for some reason i think it doesnt save to the database and just gives me a blank page this is my adding php code
<?php
/* 
 NEW.PHP
 Allows user to create a new entry in the database
*/
 // creates the new record form
 // since this form is used multiple times in this file, I have made it a function that is easily reusable
 function renderForm($id, $tit, $sal, $loc, $desc, $cat, $error)
 {
 ?>
 <?php 
 // if there are any errors, display them
 if ($error != '')
 {
 echo '<div style="padding:4px; border:1px solid red; color:red;">'.$error.'</div>';
 }
 ?> 
 <form action="" method="post">
 <div>
 <strong>ID: *</strong> <input type="text" name="id" value="<?php echo $id; ?>" /><br/>
 <strong>TITLE: *</strong> <input type="text" name="title" value="<?php echo $tit; ?>" /><br/>
 <strong>SALARY: *</strong> <input type="text" name="salary" value="<?php echo $sal; ?>" /><br/>
 <strong>LOCATION: *</strong> <input type="text" name="location" value="<?php echo $loc; ?>" /><br/>
 <strong>DESCRIPTION: *</strong> <input type="text" name="description" value="<?php echo $desc; ?>" /><br/>
 <strong>CATEGORY: *</strong> <input type="text" name="category" value="<?php echo $cat; ?>" /><br/>
 <p>* required</p>
 <input type="submit" name="submit" value="Submit">
 </div>
 </form> 
 <?php 
 }
 // check if the form has been submitted. If it has, start to process the form and save it to the database
 if (isset($_POST['Add']))
 { 
 // get form data, making sure it is valid
 $id = (htmlspecialchars($_POST['id']));
 $title = (htmlspecialchars($_POST['title']));
 $salary = (htmlspecialchars($_POST['salary']));
 $location = (htmlspecialchars($_POST['location']));
 $description = (htmlspecialchars($_POST['description']));
 $category = (htmlspecialchars($_POST['category']));
 // check to make sure both fields are entered
 if ($id == '' || $title == '' || $salary == '' || $location == '' || $description == '' || $category == '')
 {
 // generate error message
 $error = 'ERROR: Please fill in all required fields!';
 // if either field is blank, display the form again
 renderForm($id, $title, $salary, $location, $description, $category, $error);
 }
 else
 {
 // save the data to the database
 $pdo->query("INSERT jobs SET id='$id', title='$title', salary='$salary', description='$description', category='$category'")
 or die; 
 // once saved, redirect back to the view page
 header("Location: securepage.php"); 
 }
 }
 else
 // if the form hasn't been submitted, display the form
 {
 renderForm('','','','','','','');
 }
?>
i cant to figure out what is wrong and as its not showing me any errors its more difficult. But i think im sure it has something to do with the not saving to the database after Inserting. I hope someone can help me out.
my database is called vacancies and table is jobs this are the values in the table id, title, salary, location, description, category_id
please ask me if you need further details to help me out better
 
     
    