I have this code:
<a href="printable.php?job_numb=<?=$job_numb;?>"
target="new" style="color: #666 !important">
<p><?php echo $job_numb;?></p></a>
Which passes the $job_numb variable to the URL page. The page picks up the $job_numb and does this:
<?php
if( $_SERVER['REQUEST_METHOD']=='GET' && isset( $_GET['job_numb'] ) ){
$job_numb = filter_input( INPUT_GET, 'job_numb', FILTER_SANITIZE_STRING );
}
$servername = "localhost";
$username = "xxxxx";
$password = "xxxxx";
$dbname = "jobs_users";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT * FROM jobs_canjobs WHERE job_numb = $job_numb";
$job_name = $_GET['job_name'];
$comments = $_GET['comments'];
$due_date = $_GET['due_date'];
$attachment1 = $_GET['attachment1'];
$requestor = $_GET['requestor'];
$req_email = $_GET['req_email'];
$Property = $_GET['Property'];
$assignee = $_GET['assignee'];
$assign_email = $_GET['assign_email'];
$AE = $_GET['AE'];
$results = mysqli_query($conn, $sql);
?>
Which then SHOULD check if $job_numb = job_numb then load these variables. However, it is not showing anything.
I HAD all of the variables passing through the <a href but then special characters were mucking up the security and giving a 406 error. I believe this is probably a more secure option, but I am not getting something right.
Am I missing a step? Thank you.
$results = mysqli_query($conn, $sql);var_dump($results);in the end?