Execute php or vbs code

wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Execute php or vbs code

Post by wartiaga »

Hi,

How can I run an external code in php or vbs from fivewin?

Thanks!
User avatar
leandro
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia
Contact:

Re: Execute php or vbs code

Post by leandro »

Creo que lo puedes hacer usando webview, pero debes contar con un servidor web así sea de manera local.
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
Antonio Linares
Site Admin
Posts: 42273
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Execute php or vbs code

Post by Antonio Linares »

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
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

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
 
Thanks Antonio, I use xharbour, where I can find curl compiled for xharbour?
User avatar
Antonio Linares
Site Admin
Posts: 42273
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Execute php or vbs code

Post by Antonio Linares »

Enrico may help us on this

Enrico do you know where to get it ? many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Execute php or vbs code

Post by Enrico Maria Giordano »

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/
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Execute php or vbs code

Post by Enrico Maria Giordano »

Antonio, did you receive hbcurl.lib for xHarbour? I've sent it to you yesterday on 23:28.
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

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/
Enrico,
I tried to compile xharbour and curl and got several errors, can you send me the lib already compiled? Thanks.
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

Enrico Maria Giordano wrote:Here it is:

https://wormhole.app/6lE98#DrUiOoCwc3x7kgJ2O-EDDA
Thank You Enrico!
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

Enrico Maria Giordano wrote:Here it is:

https://wormhole.app/6lE98#DrUiOoCwc3x7kgJ2O-EDDA
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|hbcurl
Error: Unresolved external '_curl_global_init_mem' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_global_cleanup' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formfree' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_cleanup' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_reset' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_duphandle' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_init' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_pause' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_perform' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_send' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_recv' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formadd' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_append' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_setopt' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_getinfo' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_free_all' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_escape' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_unescape' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version_info' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_strerror' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_getdate' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_escape' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_unescape' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_free' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Execute php or vbs code

Post by Enrico Maria Giordano »

FWH 11.05? Very very old (May 2011). Could it be the reason for the errors? Antonio?
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

Enrico Maria Giordano wrote:FWH 11.05? Very very old (May 2011). Could it be the reason for the errors? Antonio?
Error: Unresolved external 'WSAIoctl' referenced from D:\LANG\FWH1105\XH1.2.1\LIB\HBCURL.LIB|hbcurl

In this case I found the solution linking ws2_32.lib

But others I think need to link others lib.
wartiaga
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Post by wartiaga »

Enrico Maria Giordano wrote:Right. Try libcurl.lib from FWH lib directory.
Good, no error, but in execution gives: Unrecoverable error 9011 - hb_xfree called with null pointer
Thank you!
Post Reply