I am using a jquery function to call a getdata.php file like this -
$("#tasks").load("getdata.php?choice=" + $("#projects").val());
The getdata.php echoes back results dynamically to the callee.
<?php //getdata.php
global $user_id; //<--These variables are defined in the callee file
global $con;
$choice=$_GET['choice'];
$query="SELECT task_id,title from tasks where user_id=$user_id AND proj_id=$choice";
$result=mysqli_query($con,$query) or die(mysqli_error($con));
if((mysqli_num_rows($res))!=0)
{
while (list($task_id, $title) = mysqli_fetch_row($result))
{
echo "<option value=$task_id>$title</option>";
}
}
else
{
echo "<option>No current Tasks</option>";
} ?>
Is there any way by which I can access the variables in the callee file from here. I tried using global as would normally be the case with included files but that's not working here.