on 11-28-2016 8:29 AM
Hello community,
I want to create an app with the HANA WebIDE that read/write some data to an .txt file.
After reading that some people run php scripts with SAPUI5 I test this, but in my case it doesn´t work.
I hope somebody find my mistake and have a suitable solution, because other community discussions aren´t so helpful.
First the php file (writeFile.php) :
<?php
function phpAlert($msg) {
$content= "123456789";
$handle = fopen ("testWrite.txt", w);
fwrite ($handle, $content);
fclose ($handle);
}
?>
Secondly the call from Javascript:
writeStringToFile: function(newContent){
$.ajax({
url: "writeFile.php",
type: "GET",
data: newContent,
async: true,
success: function(data){
console.log("Success");
}
});
}
Thanks in advance!
Besides you should add input validation, an active debugger might help giving you pointers:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
Depending of the webservers configuration required PHP functions might be disabled or other permissions are not configured properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.