Kolink's answer worked for me (change the window location to the php file), but as I want to send POST variables along with the request, I ended up using a hidden form instead. The code I am using is as follows:
var url = 'php/utils/getXMLfile.php';
var form = $('<form action="' + url + '" method="post" style="display: none;">' +
'<input type="text" name="fname" value="' + text + '" />' +
'</form>');
$('body').append(form);
$(form).submit();
Thanks for all the answers!