Antonio Linares wrote:Navigate2 method:
http://msdn.microsoft.com/en-us/library/aa752094(VS.85).aspx
Davide wrote:Antonio Linares wrote:Navigate2 method:
http://msdn.microsoft.com/en-us/library/aa752094(VS.85).aspx
Main problem here is how to translate a string like "user=username&password=mypwd" into a ByteArray (please see sub PackBytes() at http://support.microsoft.com/kb/167658) in order to do:
oActiveX:Do( "Navigate2", cURL, , , vPostData, "Content-Type: application/x-www-form-urlencoded"+CRLF)
Once this is solved we can post data to a script on a server (any script on the internet) and retrieve the dynamically generated page directly in the oActiveX object.
Hi,
Davide
#include "FiveWin.ch"
function Main()
local oExplorer := CreateObject( "shell.explorer" )
MsgInfo( GetPostData( "user=username&password=mypwd" ) )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HRESULT hb_oleVariantToItem( PHB_ITEM pItem, VARIANT * pVariant );
HB_FUNC( GETPOSTDATA )
{
VARIANT vPostData = {0};
LPSAFEARRAY psa;
LPCTSTR cszPostData = hb_parc( 1 );
UINT cElems = lstrlen( cszPostData );
LPSTR pPostData;
VariantInit( &vPostData );
psa = SafeArrayCreateVector( VT_UI1, 0, cElems );
if( ! psa )
{
hb_retnl( E_OUTOFMEMORY );
return;
}
SafeArrayAccessData( psa, ( LPVOID * ) &pPostData );
memcpy( pPostData, cszPostData, cElems );
SafeArrayUnaccessData( psa );
V_VT( &vPostData ) = VT_ARRAY | VT_UI1;
V_ARRAY( &vPostData ) = psa;
hb_oleVariantToItem( hb_param( -1, HB_IT_ANY ), &vPostData );
}
#pragma ENDDUMP
<? echo "This is a test\n"; ?>
<? echo $HTTP_POST_VARS['first']; ?>
<? echo $HTTP_POST_VARS['last']; ?>
Antonio Linares wrote:Never mind, it is not needed. I am building the test on our secure server
Just a moment...
#include "FiveWin.ch"
function Main()
local oWnd, oActiveX
DEFINE WINDOW oWnd
@ 0, 0 ACTIVEX oActiveX PROGID "Shell.Explorer" OF oWnd
oWnd:oClient = oActiveX
ACTIVATE WINDOW oWnd ;
ON INIT oActiveX:Do( "Navigate2",;
"https://www.fivetechsoft.com/secure/english/test.php",,,;
GetPostData( "first=fivewin&last=FiveTech Software" ),;
"Content-Type: application/x-www-form-urlencoded" + CRLF )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 99 guests