Jump to content

ajax v.s. directly visiting php file


qmqmqm

Recommended Posts

Hi everyone,

 

I have the following php file:

if I open the php file directly from browser, it will generate the "mytest" file.

If I use ajax to call the php file however, the "mytest" file will not be generated.

However I do receive the "hi" back from the ajax call.

 

Does anyone know why this is?

 

<?php

 

$file_path = "/mytest";

 

$file=fopen($file_path, "w");

 

fwrite($file, "test...");

 

fclose($file);

 

echo "hi";

 

?>

Link to comment
https://forums.phpfreaks.com/topic/148004-ajax-vs-directly-visiting-php-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.