Execute php or vbs code

Execute php or vbs code

Postby wartiaga » Thu Aug 31, 2023 6:19 pm

Hi,

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

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

Re: Execute php or vbs code

Postby leandro » Thu Aug 31, 2023 9:20 pm

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
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Execute php or vbs code

Postby Antonio Linares » Fri Sep 01, 2023 7:00 am

Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42113
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Execute php or vbs code

Postby wartiaga » Fri Sep 01, 2023 5:08 pm

Antonio Linares wrote:
Code: Select all  Expand view  RUN
#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?
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Postby Antonio Linares » Fri Sep 01, 2023 7:14 pm

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
Antonio Linares
Site Admin
 
Posts: 42113
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Execute php or vbs code

Postby Enrico Maria Giordano » Fri Sep 01, 2023 8:58 pm

You have to build it yourself. From winmake\readme.txt:

Code: Select all  Expand view  RUN
SET HB_DIR_CURL=<install dir>
Required to build hbcurl.lib
Download URL: http://curl.haxx.se/
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Execute php or vbs code

Postby Enrico Maria Giordano » Sat Sep 02, 2023 9:55 am

Antonio, did you receive hbcurl.lib for xHarbour? I've sent it to you yesterday on 23:28.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Execute php or vbs code

Postby wartiaga » Sat Sep 02, 2023 1:51 pm

Enrico Maria Giordano wrote:You have to build it yourself. From winmake\readme.txt:

Code: Select all  Expand view  RUN
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

Postby wartiaga » Sat Sep 02, 2023 2:56 pm

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

Postby wartiaga » Sat Sep 02, 2023 3:10 pm

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
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Execute php or vbs code

Postby Enrico Maria Giordano » Sat Sep 02, 2023 3:19 pm

FWH 11.05? Very very old (May 2011). Could it be the reason for the errors? Antonio?
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Execute php or vbs code

Postby wartiaga » Sat Sep 02, 2023 3:23 pm

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

Postby Enrico Maria Giordano » Sat Sep 02, 2023 3:29 pm

Right. Try libcurl.lib from FWH lib directory.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Execute php or vbs code

Postby wartiaga » Sat Sep 02, 2023 3:44 pm

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!
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 84 guests