This
if(isset($_POST['keyword']) && $_POST['keyword']!="")
Can be written more succinctly as
if(!empty($_POST['keyword']))
Now, if your echo'd statements are anything to go by, your logic is a bit confused. The first if statement is true no matter what job_sector is or whether it's set or not - obvious, really, since it doesn't even mention job_sector any more than it mentions rice_pudding. So whenever $_POST['keyword'] is not empty, the first branch ('this is keyword only selected') will be executed. The second branch never will, because the program will never get to that point.
Say $POST['keyword'] is empty. The program will skip over the first branch, skip over the second branch, and run the third branch. $POST['job_sector'] has nothing to do with this.
On the other hand, say $_POST['keyword'] is not empty. The program will run the first branch. The second branch is never reached.
Obviously, we want to look at $_POST['job_sector'] at some point before we decide which branch to take. A wee bit of rearranging will fix things.
if(!empty($_POST['keyword']) && !empty($_POST['job_sector']))
{
echo "this is keyword and job_sector";
}
elseif(!empty($_POST['keyword']))
{
echo "this is keyword only selected";
}
else{
echo"pis off";
}
And that could be simplified even further.
if(!empty($_POST['keyword'])
{ if(!empty($_POST['job_sector']))
{
echo "this is keyword and job_sector";
}
else
{
echo "this is keyword only selected";
}
}
else
{ echo"pis off";
}
And isn't that easier to read when [PHP] tags are used?