I'm trying to return the answer $returnans but it keeps telling me undefined index in line159. If anyone would be so kind to answer how I can fix this it would be greetly appreciated. Thanks
if(isset($_POST['getprices'])){
$destination_input=$_POST['destination'];
$travellers_input=$_POST['travellersno'];
define("CADEST1", 12.00); //destination of uk and europe company a
define("CADEST2", 18.00); //destination of other regions company a
define("CBDEST1", 19.00); //destination of uk and europe company b
define("CBDEST2", 24.00); //destination of other regions company b
define("CCDEST1", 21.00); //destination of uk and europe company c
define("CCDEST2", 27.00); //destination of other regions company c
function companyA($destination_input,$travellers_input)
{
if($destination_input=="europe" || $destination_input=="uk")
{
$total1=$travellers_input* CADEST1;
$returnans=$travellers_input." Persons at 12.00 to ". $destination_input. " = ". $total1;
}
else if($destination_input=="worldwideexcluding" || $destination_input=="worldwideincluding" || $destination_input=="australianewzealand")
{
$total2=$travellers_input* CADEST2;
$returnans=$travellers_input." Persons at 18.00 to ". $destination_input. " = ". $total2;
}
return $returnans;
}
function companyB($destination_input,$travellers_input)
{
}
function companyC($destination_input,$travellers_input)
{
}
echo"<h3>Company A-Quote</h3>";
$returnans=companyA($travellers_input,$destination_input);
echo $returnans;
var_dump($returnans);