<?php
$allBookings = [
"IMD002" => [
"client" => "James Holden",
"paid" => "yes",
"email" => "james.holden@gmail.com"
],
"IMD003" => [
"client" => "Harold P. Redman",
"paid" => "yes",
"email" => "HaroldPRedman@dayrep.com"
],
"IMD004" => [
"client" => "Marcus C. Nelson",
"paid" => "no",
"email" => "MarcusCNelson@armyspy.com"
]
];
// DONT EDIT ANYTHING BELOW HERE
if(!empty($_POST)) {
$clientName = $booking['client'];
}
else {
$clientName = null;
};
?>
<!-- DONT EDIT ANYTHING BELOW HERE -->
<div class="myApp">
<form method="post">
<input type="text" name="bookingReference" placeholder="Booking Reference">
<input type="submit" value="Find Client">
</form>
<h2 id="result_name">Client name: <em><?php echo $clientName; ?></em></h2>
</div>
How can I showup the credentials when I type into the input field (booking reference) for example "IMD002"? As it should show up the array listed in php under "IMD002". I'm assuming its something to do with a $_POST
statement?
Thanks alot
</div>