I have been trying to use a MySQLi->prepare statement to query a database and then echo the results onto another page in my site. I have been able to get this to work and display the results onto the same page as the query but not able to put the results onto the other webpage. Please help.. Here is my code.
Here is the code for the process page:
<?php
include_once 'db_connect.php';
include_once 'psl-config.php';
include_once 'functions.php';
sec_session_start();
$error_msg = "";
if (isset($_GET['subject']))
$subject = $_GET['subject'];
if (isset($_GET['set_date']))
$set_date = $_GET['set_date'];
if (isset($_GET['set_time']))
$set_time = $_GET['set_time'];
if (isset($_GET['result']))
$result = $_GET['result'];
if (isset($_GET['employee']))
$employee = $_GET['employee'];
if (isset($_GET['project']))
$employee = $_GET['project'];
if (isset($_GET['source']))
$source = $_GET['source'];
if (isset($_GET['appt_date']))
$appt_date = $_GET['appt_date'];
if (isset($_GET['branch']))
$branch = $_GET['branch'];
if (isset($_GET['fname']))
$fname = $_GET['fname'];
if (isset($_GET['lname']))
$lname = $_GET['lname'];
if (isset($_GET['last_four']))
$last_four = $_GET['last_four'];
if (isset($_GET['phone']))
$phone = $_GET['phone'];
if (isset($_GET['city']))
$city = $_GET['city'];
if (isset($_GET['state']))
$state = $_GET['state'];
if (isset($_GET['zip']))
$zip = $_GET['zip'];
if (isset($_GET['monthly_net']))
$monthly_net = $_GET['monthly_net'];
if (isset($_GET['job_time']))
$job_time = $_GET['job_time'];
$query = $mysqli->prepare("SELECT subject, set_date, set_time, result, employee, project, source, appt_date, branch, fname, lname, last_four, phone, city, state, zip, monthly_net, job_time FROM appointments WHERE set_date LIKE CONCAT('%', ?, '%') AND result LIKE CONCAT('%', ?, '%') AND employee LIKE CONCAT('%', ?, '%') AND project LIKE CONCAT('%', ?, '%') AND source LIKE CONCAT('%', ?, '%') AND appt_date LIKE CONCAT('%', ?, '%') AND branch LIKE CONCAT('%', ?, '%') AND fname LIKE CONCAT('%', ?, '%') AND lname LIKE CONCAT('%', ?, '%') AND last_four LIKE CONCAT('%', ?, '%') AND phone LIKE CONCAT('%', ?, '%') AND city LIKE CONCAT('%', ?, '%') AND state LIKE CONCAT('%', ?, '%') AND zip LIKE CONCAT('%', ?, '%') ORDER BY employee");
$query->bind_param('ssssssssssssss', $_GET['set_date'], $_GET['result'], $_GET['employee'], $_GET['project'], $_GET['source'], $_GET['appt_date'], $_GET['branch'], $_GET['fname'], $_GET['lname'], $_GET['last_four'], $_GET['phone'], $_GET['city'], $_GET['state'], $_GET['zip']);
$query->execute();
$query->store_result();
$query->bind_result($subject, $set_date, $set_time, $result, $employee, $project, $source, $appt_date, $branch, $fname, $lname, $last_four, $phone, $city, $state, $zip, $monthly_net, $job_time);
while($results = $query->fetch()) {
$subject = $results['subject'];
$set_date = $results['set_date'];
$set_time = $results['set_time'];
$result = $results['result'];
$employee = $results['employee'];
$project = $results['project'];
$source = $results['source'];
$appt_date = $results['appt_date'];
$branch = $results['branch'];
$fname = $results['fname'];
$lname = $results['lname'];
$last_four = $results['last_four'];
$phone = $results['phone'];
$city = $results['city'];
$state = $results['state'];
$zip = $results['zip'];
$monthly_net = $results['monthly_net'];
$job_time = $results['job_time'];
}
$_SESSION['subject'] = $subject;
$_SESSION['set_date'] = $set_date;
$_SESSION['set_time'] = $set_time;
$_SESSION['result'] = $result;
$_SESSION['employee'] = $employee;
$_SESSION['project'] = $project;
$_SESSION['source'] = $source;
$_SESSION['appt_date'] = $appt_date;
$_SESSION['branch'] = $branch;
$_SESSION['fname'] = $fname;
$_SESSION['lname'] = $lname;
$_SESSION['last_four'] = $last_four;
$_SESSION['phone'] = $phone;
$_SESSION['city'] = $city;
$_SESSION['state'] = $state;
$_SESSION['zip'] = $zip;
$_SESSION['monthly_net'] = $monthly_net;
$_SESSION['job_time'] = $job_time;
if ($_SESSION['employee']) {
header('Location: ../appointments_page.php');
} else {
header('Location: ../appointments.php?error=1');
}
$query->free_result();
$mysqli->close();
?>
And Here is the code to the page I want to display the results:
<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
include_once 'includes/appointments.inc.php';
sec_session_start();
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Welcome | Mountain and Alpine Loan Centers</title>
<meta name="description" content="Mountain and Alpine Loan Centers">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script type="text/JavaScript" src="js/sha512.js"></script>
<script type="text/JavaScript" src="js/forms.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div align="center">
<img src="../img/Logo4_Black_Red.jpg" height="126" width="266">
<nav id="nav01"></nav></div>
<div align="center"><br><br><br>
<?php
if(isset($_SESSION['subject']) && isset($_SESSION['set_date']) && isset($_SESSION['set_time']) && isset($_SESSION['result']) && isset($_SESSION['employee']) && isset($_SESSION['project']) && isset($_SESSION['source']) && isset($_SESSION['appt_date']) && isset($_SESSION['branch']) && isset($_SESSION['fname']) && isset($_SESSION['lname']) && isset($_SESSION['last_four']) && isset($_SESSION['phone']) && isset($_SESSION['city']) && isset($_SESSION['state']) && isset($_SESSION['zip']) && isset($_SESSION['monthly_net']) && isset($_SESSION['job_time'])) {
echo "<table border='1'>";
echo "<tr>";
echo "<th>Subject</th>";
echo "<th>Date Set</th>";
echo "<th>Time Set</th>";
echo "<th>Result</th>";
echo "<th>Employee</th>";
echo "<th>Project</th>";
echo "<th>Source</th>";
echo "<th>Appointment Date</th>";
echo "<th>Branch</th>";
echo "<th>First Name</th>";
echo "<th>Last Name</th>";
echo "<th>Last Four</th>";
echo "<th>Phone</th>";
echo "<th>City</th>";
echo "<th>State</th>";
echo "<th>Zip</th>";
echo "<th>Monthly Net</th>";
echo "<th>Time at Job</th>";
echo "</tr>";
for($i=0;$i<count($_SESSION['subject']);$i++) {
echo "<tr>";
echo "<td>{$_SESSION['subject'][$i]}</td>";
echo "<td>{$_SESSION['set_date'][$i]}</td>";
echo "<td>{$_SESSION['set_time'][$i]}</td>";
echo "<td>{$_SESSION['result'][$i]}</td>";
echo "<td>{$_SESSION['employee'][$i]}</td>";
echo "<td>{$_SESSION['project'][$i]}</td>";
echo "<td>{$_SESSION['source'][$i]}</td>";
echo "<td>{$_SESSION['appt_date'][$i]}</td>";
echo "<td>{$_SESSION['branch'][$i]}</td>";
echo "<td>{$_SESSION['fname'][$i]}</td>";
echo "<td>{$_SESSION['lname'][$i]}</td>";
echo "<td>{$_SESSION['last_four'][$i]}</td>";
echo "<td>{$_SESSION['phone'][$i]}</td>";
echo "<td>{$_SESSION['city'][$i]}</td>";
echo "<td>{$_SESSION['state'][$i]}</td>";
echo "<td>{$_SESSION['zip'][$i]}</td>";
echo "<td>{$_SESSION['monthly_net'][$i]}</td>";
echo "<td>{$_SESSION['job_time'][$i]}</td>";
echo "</tr>";
echo "</table>";
}
}else{
echo "No Records Found";
}
?>
<p>Return to the<a href="index.php">login page</a></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="../js/script.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>
UPDATE: I have made the changes that have been suggested but am getting sent to my 'else' error page. I know the query I'm running brought back and displayed results when I was displaying them on the same page as the query.
Here is the new code for the Processing Page
<?php
include_once 'db_connect.php';
include_once 'psl-config.php';
include_once 'functions.php';
sec_session_start();
$error_msg = "";
if (isset($_GET['subject']))
$subject = $_GET['subject'];
if (isset($_GET['set_date']))
$set_date = $_GET['set_date'];
if (isset($_GET['set_time']))
$set_time = $_GET['set_time'];
if (isset($_GET['result']))
$result = $_GET['result'];
if (isset($_GET['employee']))
$employee = $_GET['employee'];
if (isset($_GET['project']))
$employee = $_GET['project'];
if (isset($_GET['source']))
$source = $_GET['source'];
if (isset($_GET['appt_date']))
$appt_date = $_GET['appt_date'];
if (isset($_GET['branch']))
$branch = $_GET['branch'];
if (isset($_GET['fname']))
$fname = $_GET['fname'];
if (isset($_GET['lname']))
$lname = $_GET['lname'];
if (isset($_GET['last_four']))
$last_four = $_GET['last_four'];
if (isset($_GET['phone']))
$phone = $_GET['phone'];
if (isset($_GET['city']))
$city = $_GET['city'];
if (isset($_GET['state']))
$state = $_GET['state'];
if (isset($_GET['zip']))
$zip = $_GET['zip'];
if (isset($_GET['monthly_net']))
$monthly_net = $_GET['monthly_net'];
if (isset($_GET['job_time']))
$job_time = $_GET['job_time'];
$query = $mysqli->prepare("SELECT subject, set_date, set_time, result, employee, project, source, appt_date, branch, fname, lname, last_four, phone, city, state, zip, monthly_net, job_time FROM appointments WHERE set_date LIKE CONCAT('%', ?, '%') AND result LIKE CONCAT('%', ?, '%') AND employee LIKE CONCAT('%', ?, '%') AND project LIKE CONCAT('%', ?, '%') AND source LIKE CONCAT('%', ?, '%') AND appt_date LIKE CONCAT('%', ?, '%') AND branch LIKE CONCAT('%', ?, '%') AND fname LIKE CONCAT('%', ?, '%') AND lname LIKE CONCAT('%', ?, '%') AND last_four LIKE CONCAT('%', ?, '%') AND phone LIKE CONCAT('%', ?, '%') AND city LIKE CONCAT('%', ?, '%') AND state LIKE CONCAT('%', ?, '%') AND zip LIKE CONCAT('%', ?, '%') ORDER BY employee");
$query->bind_param('ssssssssssssss', $_GET['set_date'], $_GET['result'], $_GET['employee'], $_GET['project'], $_GET['source'], $_GET['appt_date'], $_GET['branch'], $_GET['fname'], $_GET['lname'], $_GET['last_four'], $_GET['phone'], $_GET['city'], $_GET['state'], $_GET['zip']);
$query->execute();
$query->store_result();
$query->bind_result($subject, $set_date, $set_time, $result, $employee, $project, $source, $appt_date, $branch, $fname, $lname, $last_four, $phone, $city, $state, $zip, $monthly_net, $job_time);
$results = array();
while($row = $query->fetch()) {
$results = $row;
}
$_SESSION['results'] = $results;
if ($results) {
header('Location: ../appointments_page.php');
} else {
header('Location: ../appointments.php?error=1');
}
$query->free_result();
$mysqli->close();
?>
And the new code for the Display Page:
<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
include_once 'includes/appointments.inc.php';
sec_session_start();
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Welcome | Mountain and Alpine Loan Centers</title>
<meta name="description" content="Mountain and Alpine Loan Centers">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script type="text/JavaScript" src="js/sha512.js"></script>
<script type="text/JavaScript" src="js/forms.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div align="center">
<img src="../img/Logo4_Black_Red.jpg" height="126" width="266">
<nav id="nav01"></nav></div>
<div align="center"><br><br><br>
<?php
$results = $_SESSION['results'];
if($results) {
echo "<table border='1'>";
echo "<tr>";
echo "<th>Subject</th>";
echo "<th>Date Set</th>";
echo "<th>Time Set</th>";
echo "<th>Result</th>";
echo "<th>Employee</th>";
echo "<th>Project</th>";
echo "<th>Source</th>";
echo "<th>Appointment Date</th>";
echo "<th>Branch</th>";
echo "<th>First Name</th>";
echo "<th>Last Name</th>";
echo "<th>Last Four</th>";
echo "<th>Phone</th>";
echo "<th>City</th>";
echo "<th>State</th>";
echo "<th>Zip</th>";
echo "<th>Monthly Net</th>";
echo "<th>Time at Job</th>";
echo "</tr>";
foreach($_SESSION['results'] as $result) {
echo "<tr>";
echo "<td>{$result['subject']}</td>";
echo "<td>{$result['set_date']}</td>";
echo "<td>{$result['set_time']}</td>";
echo "<td>{$result['result']}</td>";
echo "<td>{$result['employee']}</td>";
echo "<td>{$result['project']}</td>";
echo "<td>{$result['source']}</td>";
echo "<td>{$result['appt_date']}</td>";
echo "<td>{$result['branch']}</td>";
echo "<td>{$result['fname']}</td>";
echo "<td>{$result['lname']}</td>";
echo "<td>{$result['last_four']}</td>";
echo "<td>{$result['phone']}</td>";
echo "<td>{$result['city']}</td>";
echo "<td>{$result['state']}</td>";
echo "<td>{$result['zip']}</td>";
echo "<td>{$result['monthly_net']}</td>";
echo "<td>{$result['job_time']}</td>";
echo "</tr>";
}
}else{
echo "No Records Found";
}
?>
<p>Return to the<a href="index.php">login page</a></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="../js/script.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>
I'm not getting any 'errors' reported so I feel like I'm close to solving this.
UPDATE #2 - Still getting sent to the error page. Here is how the code looks now:
Process Page:
<?php
include_once 'db_connect.php';
include_once 'psl-config.php';
include_once 'functions.php';
sec_session_start();
$error_msg = "";
if (isset($_GET['subject']))
$subject = $_GET['subject'];
if (isset($_GET['set_date']))
$set_date = $_GET['set_date'];
if (isset($_GET['set_time']))
$set_time = $_GET['set_time'];
if (isset($_GET['result']))
$result = $_GET['result'];
if (isset($_GET['employee']))
$employee = $_GET['employee'];
if (isset($_GET['project']))
$employee = $_GET['project'];
if (isset($_GET['source']))
$source = $_GET['source'];
if (isset($_GET['appt_date']))
$appt_date = $_GET['appt_date'];
if (isset($_GET['branch']))
$branch = $_GET['branch'];
if (isset($_GET['fname']))
$fname = $_GET['fname'];
if (isset($_GET['lname']))
$lname = $_GET['lname'];
if (isset($_GET['last_four']))
$last_four = $_GET['last_four'];
if (isset($_GET['phone']))
$phone = $_GET['phone'];
if (isset($_GET['city']))
$city = $_GET['city'];
if (isset($_GET['state']))
$state = $_GET['state'];
if (isset($_GET['zip']))
$zip = $_GET['zip'];
if (isset($_GET['monthly_net']))
$monthly_net = $_GET['monthly_net'];
if (isset($_GET['job_time']))
$job_time = $_GET['job_time'];
$query = $mysqli->prepare("SELECT subject, set_date, set_time, result, employee, project, source, appt_date, branch, fname, lname, last_four, phone, city, state, zip, monthly_net, job_time FROM appointments WHERE set_date LIKE CONCAT('%', ?, '%') AND result LIKE CONCAT('%', ?, '%') AND employee LIKE CONCAT('%', ?, '%') AND project LIKE CONCAT('%', ?, '%') AND source LIKE CONCAT('%', ?, '%') AND appt_date LIKE CONCAT('%', ?, '%') AND branch LIKE CONCAT('%', ?, '%') AND fname LIKE CONCAT('%', ?, '%') AND lname LIKE CONCAT('%', ?, '%') AND last_four LIKE CONCAT('%', ?, '%') AND phone LIKE CONCAT('%', ?, '%') AND city LIKE CONCAT('%', ?, '%') AND state LIKE CONCAT('%', ?, '%') AND zip LIKE CONCAT('%', ?, '%') ORDER BY employee");
$query->bind_param('ssssssssssssss', $_GET['set_date'], $_GET['result'], $_GET['employee'], $_GET['project'], $_GET['source'], $_GET['appt_date'], $_GET['branch'], $_GET['fname'], $_GET['lname'], $_GET['last_four'], $_GET['phone'], $_GET['city'], $_GET['state'], $_GET['zip']);
$query->execute();
$query->store_result();
$query->bind_result($subject, $set_date, $set_time, $result, $employee, $project, $source, $appt_date, $branch, $fname, $lname, $last_four, $phone, $city, $state, $zip, $monthly_net, $job_time);
$results = array();
while($row = $query->fetch()) {
$results[] = array(
'subject' => $subject,
'set_date' => $set_date,
'set_time' => $set_time,
'result' => $result,
'employee' => $employee,
'project' => $project,
'source' => $source,
'appt_date' => $appt_date,
'branch' => $branch,
'fname' => $fname,
'lname' => $lname,
'last_four' => $last_four,
'phone' => $phone,
'city' => $city,
'state' => $state,
'zip' => $zip,
'monthly_net' => $monthly_net,
'job_time' => $job_time
);
}
$_SESSION['results'] = $results;
if ($results) {
header('Location: ../appointments_page.php');
} else {
header('Location: ../appointments.php?error=1');
}
$query->free_result();
$mysqli->close();
?>
Display Page:
<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
include_once 'includes/appointments.inc.php';
sec_session_start();
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Welcome | Mountain and Alpine Loan Centers</title>
<meta name="description" content="Mountain and Alpine Loan Centers">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script type="text/JavaScript" src="js/sha512.js"></script>
<script type="text/JavaScript" src="js/forms.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div align="center">
<img src="../img/Logo4_Black_Red.jpg" height="126" width="266">
<nav id="nav01"></nav></div>
<div align="center"><br><br><br>
<?php
$results = $_SESSION['results'];
if($results) {
echo "<table border='1'>";
echo "<tr>";
echo "<th>Subject</th>";
echo "<th>Date Set</th>";
echo "<th>Time Set</th>";
echo "<th>Result</th>";
echo "<th>Employee</th>";
echo "<th>Project</th>";
echo "<th>Source</th>";
echo "<th>Appointment Date</th>";
echo "<th>Branch</th>";
echo "<th>First Name</th>";
echo "<th>Last Name</th>";
echo "<th>Last Four</th>";
echo "<th>Phone</th>";
echo "<th>City</th>";
echo "<th>State</th>";
echo "<th>Zip</th>";
echo "<th>Monthly Net</th>";
echo "<th>Time at Job</th>";
echo "</tr>";
foreach($_SESSION['results'] as $result) {
echo "<tr>";
echo "<td>{$result['subject']}</td>";
echo "<td>{$result['set_date']}</td>";
echo "<td>{$result['set_time']}</td>";
echo "<td>{$result['result']}</td>";
echo "<td>{$result['employee']}</td>";
echo "<td>{$result['project']}</td>";
echo "<td>{$result['source']}</td>";
echo "<td>{$result['appt_date']}</td>";
echo "<td>{$result['branch']}</td>";
echo "<td>{$result['fname']}</td>";
echo "<td>{$result['lname']}</td>";
echo "<td>{$result['last_four']}</td>";
echo "<td>{$result['phone']}</td>";
echo "<td>{$result['city']}</td>";
echo "<td>{$result['state']}</td>";
echo "<td>{$result['zip']}</td>";
echo "<td>{$result['monthly_net']}</td>";
echo "<td>{$result['job_time']}</td>";
echo "</tr>";
}
}else{
echo "No Records Found";
}
?>
<p>Return to the<a href="index.php">login page</a></p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="../js/script.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>
UPDATE #3 - The results display but on the Process Page and not the Display Page when I use var_dump($results).
Process Page (version 3):
<?php
include_once 'db_connect.php';
include_once 'psl-config.php';
include_once 'functions.php';
sec_session_start();
$error_msg = "";
if (isset($_GET['subject']))
$subject = $_GET['subject'];
if (isset($_GET['set_date']))
$set_date = $_GET['set_date'];
if (isset($_GET['set_time']))
$set_time = $_GET['set_time'];
if (isset($_GET['result']))
$result = $_GET['result'];
if (isset($_GET['employee']))
$employee = $_GET['employee'];
if (isset($_GET['project']))
$employee = $_GET['project'];
if (isset($_GET['source']))
$source = $_GET['source'];
if (isset($_GET['appt_date']))
$appt_date = $_GET['appt_date'];
if (isset($_GET['branch']))
$branch = $_GET['branch'];
if (isset($_GET['fname']))
$fname = $_GET['fname'];
if (isset($_GET['lname']))
$lname = $_GET['lname'];
if (isset($_GET['last_four']))
$last_four = $_GET['last_four'];
if (isset($_GET['phone']))
$phone = $_GET['phone'];
if (isset($_GET['city']))
$city = $_GET['city'];
if (isset($_GET['state']))
$state = $_GET['state'];
if (isset($_GET['zip']))
$zip = $_GET['zip'];
if (isset($_GET['monthly_net']))
$monthly_net = $_GET['monthly_net'];
if (isset($_GET['job_time']))
$job_time = $_GET['job_time'];
$query = $mysqli->prepare("SELECT subject, set_date, set_time, result, employee, project, source, appt_date, branch, fname, lname, last_four, phone, city, state, zip, monthly_net, job_time FROM appointments WHERE set_date LIKE CONCAT('%', ?, '%') AND result LIKE CONCAT('%', ?, '%') AND employee LIKE CONCAT('%', ?, '%') AND project LIKE CONCAT('%', ?, '%') AND source LIKE CONCAT('%', ?, '%') AND appt_date LIKE CONCAT('%', ?, '%') AND branch LIKE CONCAT('%', ?, '%') AND fname LIKE CONCAT('%', ?, '%') AND lname LIKE CONCAT('%', ?, '%') AND last_four LIKE CONCAT('%', ?, '%') AND phone LIKE CONCAT('%', ?, '%') AND city LIKE CONCAT('%', ?, '%') AND state LIKE CONCAT('%', ?, '%') AND zip LIKE CONCAT('%', ?, '%') ORDER BY employee");
$query->bind_param('ssssssssssssss', $_GET['set_date'], $_GET['result'], $_GET['employee'], $_GET['project'], $_GET['source'], $_GET['appt_date'], $_GET['branch'], $_GET['fname'], $_GET['lname'], $_GET['last_four'], $_GET['phone'], $_GET['city'], $_GET['state'], $_GET['zip']);
$query->execute();
$query->store_result();
$query->bind_result($subject, $set_date, $set_time, $result, $employee, $project, $source, $appt_date, $branch, $fname, $lname, $last_four, $phone, $city, $state, $zip, $monthly_net, $job_time);
$results = array();
while($row = $query->fetch()) {
$results[] = array(
'subject' => $subject,
'set_date' => $set_date,
'set_time' => $set_time,
'result' => $result,
'employee' => $employee,
'project' => $project,
'source' => $source,
'appt_date' => $appt_date,
'branch' => $branch,
'fname' => $fname,
'lname' => $lname,
'last_four' => $last_four,
'phone' => $phone,
'city' => $city,
'state' => $state,
'zip' => $zip,
'monthly_net' => $monthly_net,
'job_time' => $job_time
);
}
$_SESSION['results'] = $results;
if($results) {
var_dump($results);
header('Location: ../appointments_page.php');
} else {
header('Location: ../appointments.php?error=1');
}
$query->free_result();
$mysqli->close();
?>