can i read local server file ?
Posted: Wed Oct 19, 2016 3:28 pm
hi , i am trying read some file .txt in local server ... but when i call command > readString , dont get any string ...
- a basic to master the web -
https://forums.spiderbasic.com/
this doesn't work with JavaScript. You need to call a server-side script.skinkairewalker wrote:hi , i am trying read some file .txt in local server ...
Code: Select all
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
Debug Result$
Else
Debug "HTTPRequest(): Error"
EndIf
EndProcedure
; Get the content of this file, and display it in the debug window
HTTPRequest(#PB_HTTP_Get, "http://localhost/readfile/readfile.php", "", @HttpGetEvent())
Code: Select all
<?php
header('Access-Control-Allow-Origin: http://127.0.0.1:9080');
echo file_get_contents("test.txt");
?>