Execute php or vbs code
Posted: Thu Aug 31, 2023 6:19 pm
Hi,
How can I run an external code in php or vbs from fivewin?
Thanks!
How can I run an external code in php or vbs from fivewin?
Thanks!
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
Code: Select all | Expand
#include "c:\harbour\contrib\hbcurl\hbcurl.ch"
function Main()
curl_global_init()
? "Hello world"
? callPHP( "www.fivetechsoft.com/getip.php" )
curl_global_cleanup()
return nil
function callPHP( cUrl )
local hCurl, uValue
if ! empty( hCurl := curl_easy_init() )
curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl )
curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
if curl_easy_perform( hCurl ) == 0
uValue = curl_easy_dl_buff_get( hCurl )
endif
endif
return uValue
Thanks Antonio, I use xharbour, where I can find curl compiled for xharbour?Antonio Linares wrote:Code: Select all | Expand
#include "c:\harbour\contrib\hbcurl\hbcurl.ch" function Main() curl_global_init() ? "Hello world" ? callPHP( "www.fivetechsoft.com/getip.php" ) curl_global_cleanup() return nil function callPHP( cUrl ) local hCurl, uValue if ! empty( hCurl := curl_easy_init() ) curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl ) curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP ) if curl_easy_perform( hCurl ) == 0 uValue = curl_easy_dl_buff_get( hCurl ) endif endif return uValue
Code: Select all | Expand
SET HB_DIR_CURL=<install dir>
Required to build hbcurl.lib
Download URL: http://curl.haxx.se/
Enrico,Enrico Maria Giordano wrote:You have to build it yourself. From winmake\readme.txt:
Code: Select all | Expand
SET HB_DIR_CURL=<install dir> Required to build hbcurl.lib Download URL: http://curl.haxx.se/
Thank You Enrico!
Enrico, using Antonio's example, I have several errors. Need some other lib?
Error: Unresolved external 'WSAIoctl' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurlEnrico Maria Giordano wrote:FWH 11.05? Very very old (May 2011). Could it be the reason for the errors? Antonio?
Good, no error, but in execution gives: Unrecoverable error 9011 - hb_xfree called with null pointerEnrico Maria Giordano wrote:Right. Try libcurl.lib from FWH lib directory.