NEW PLEASE LOOK--- so great news i got it working but its only looking at my first if statement I just need help so if its not TX then it should look at the other ELSEIF statements! Please and thxs!
OLD---I'm passing via HTML form btn to this code and I'm wanting to grab it look into my database and find the state assigned to it via that billing telephone number so if the state comes back as TX I want it to display in east.php if it comes back at KS I want it to be displayed in kc.php and of course if its CA I want it to display ca.php I've been racking at it for awhile so unless I have then put in what state the customer is from which I don't want to do cause not everyone will know what state the person is from! i've looked at a couple different things and cant find anything closest I've seen is this using php and mysql to display a specific URL in iFrame V2
include 'db_connect.php';
$mysqli = new mysqli($host, $user, $password, $database_in_use);
$btnfromform = $_GET['btn'];
$sql = "SELECT btn, state FROM legacy_escalation Where btn LIKE '".$btnfromform."'";
$result = $mysqli->query($sql);
?>
<?php
if ($result->num_rows > 0)
while($row=mysqli_fetch_assoc($result))
{
$state=$row['state'];
?>
<?php
if($state='tx')
include 'east.php';
elseif ($state='KS')
include 'kc.php';
elseif ($state='CA')
include 'ca.php';
?>
<?php
}
else {
echo "<span style='color:red; font-size:20px;'>No results found.</span>";
}
?> ```