i am trying to redirect after submitting some data into my database to example.php i have the form and it submits perfect but cant get the redirect to work i have tried a few methods i have seen on the internet but nothing worked
<html>
    <head>
        <title>MySQLi Create Record</title>
    </head>
<body>
<?php
$action = isset($_POST['action']) ? $_POST['action'] : "";
if($action=='create'){
        //include database connection
        include 'db_connect.php';
        //write query
        $query = "insert into referb 
                                set
                                        make = '".$mysqli->real_escape_string($_POST['make'])."', 
                                        model = '".$mysqli->real_escape_string($_POST['model'])."',
                                        unitt  = '".$mysqli->real_escape_string($_POST['unitt'])."'";
        if( $mysqli->query($query) ) {
                echo " header( 'Location: example.php' ) ;";
        }else{
                echo "Database Error: Unable to create record.";
        }
        $mysqli->close();
}
?>
<!--we have our html form here where user information will be entered-->
<form action='#' method='post' border='0'>
    <table>
        <tr>
            <td>Manufactor</td>
            <td><input type='text' name='make' /></td>
        </tr>
        <tr>
            <td>Model</td>
            <td><input type='text' name='model' /></td>
        </tr>
        <tr>
            <td>Unit Type</td>
            <td>
            <select name='unitt'>
  <option>Laptop</option>
  <option>Computer</option>
  <option>Tablet</option>
</select></td>
        </tr>
            <td></td>
            <td>
                <input type='hidden' name='action' value='create' />
                <input type='submit' value='Save' />
                                <a href='index.php'>Back to index</a>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
 
     
     
     
     
     
    