Undefined index error in PHP

Closed
haqyar572 Posts 1 Registration date Wednesday April 11, 2018 Status Member Last seen April 11, 2018 - Updated on Apr 11, 2018 at 07:53 AM
BunoCS Posts 15495 Registration date Monday July 11, 2005 Status Moderator Last seen October 23, 2024 - Apr 11, 2018 at 07:53 AM
Hello
May someone have time for this
I have a error in the following code
It's undefined index error
Please help me

<?php 
error_reporting(); 

include('load/session.php'); 
include('connection.php'); 
include('header.php');?> 
<div> 
<table> 
<tr> 
<td> <?php echo $travel_details=$_POST['travel_id']; ?> </td> 
<td> <?php echo $bus_id = $_POST['bus_id']; ?> </td> 
<td> <?php echo $dates = $_POST['fdate']; ?> </td> 
<td> <?php echo $route_id = $_POST['route_id'];?> </td> 
<td> <?php echo $adult = $_POST['person']; ?> </td> 
<td> <?php echo $seniur = $_POST['seniur']; ?> </td> 
<td> <?php echo $child = $_POST['Child']; ?> </td> 
<td> <?php echo $price = $_POST['price']; ?> </td> 

</tr> 
</div> 
<?php 
//echo $traveler; 

$seats = ""; 
$sql = mysql_query("SELECT seats FROM `reserve_bus` where `travel_date` = '$dates' AND `bus_id` = '$bus_id' AND route_id = '$route_id'") or die("error". mysql_error()); 

while($info = mysql_fetch_array($sql)) 
{ 
$seats = $seats.$info['seats'].","; 
} 

$bus_type = mysql_fetch_array(mysql_query("SELECT * FROM bus_details WHERE bus_id = '$bus_id'")); 
$bustype = $bus_type['bus_type']; 
if($bustype=='acsleep' || $bustype=='nonacsleep'){ include('bus/sleeping.php'); } 
elseif($bustype== 'acshitsleep'|| $bustype== 'nonacshitsleep' ){ include('bus/shittingsleep.php'); } 
elseif($bustype== 'acshite' || $bustype== 'nonacshit'){ include('bus/shittingseats.php'); } 



include('footer.php'); 
?>


Thanks

1 response

BunoCS Posts 15495 Registration date Monday July 11, 2005 Status Moderator Last seen October 23, 2024 1,533
Apr 11, 2018 at 07:53 AM
Hello,

What is the complete message ? You should have a line in the log
0