I set a Super global variable $GLOBALS['Type']="JobSeeker"
but in another file that variable is not accessed While Running Program am getting Undefined Index:Type
.
Page1.php:
$con = mysqli_connect("localhost","root","","job1");
// Specify the query to execute
$sql = "select * from JobSeeker_registration where JobSeekerId='".$ID."' ";
// Execute query
$result = mysqli_query($con,$sql);
// Loop through each records
$row = mysqli_fetch_array($result);
$GLOBALS['Name']=$row['JobSeekerName'];
$GLOBALS['Email']=$row['Email'];
$GLOBALS['Approval']="Confirm";
$GLOBALS['Type']="JobSeeker";
.
.
.
.
include '../Mailing/MailSending.php';
MailSending.php:
if($GLOBALS['Type']=="JobSeeker") //Here is Error:-Undefined Index of Type
{
if($GLOBALS['Approval']=="Pending")
{
$UserName=$GLOBALS['Email'];
$mail->addAddress($UserName, $GLOBALS['Name']);
$mail->Subject = 'Registration Mail';
$mail->msgHTML(file_get_contents("Mailing/Pending.html"), __DIR__);
$GLOBALS['Email']="";
$GLOBALS['Type']="";
$GLOBALS['Name']="";
$GLOBALS['Approval']="";
}
elseif ($GLOBALS['Approval']=="Confirm")
{
$UserName=$GLOBALS['Email'];
$mail->addAddress($UserName, $GLOBALS['Name']);
$mail->Subject = 'Registration Confirmation Mail';
$mail->msgHTML(file_get_contents("Mailing/Confirm.html"), __DIR__);
$GLOBALS['Email']="";
$GLOBALS['Type']="";
$GLOBALS['Name']="";
$GLOBALS['Approval']="";
}
}
I tried with Different Names But did not get any solution.