Restored from previous forum. Originally posted by tranquil.
Hi All!
I want to get Datas out of a WebSite eg. a "string-gadget" on a website and the selected item of a combobox gadget after pressing a buttongadget.
How could I realize that? I suggested the action of a "GO" button will start a small .exe with commandline-parameters of the stringgadget and the combobox gadget. but how to realize it!?
Anyone have suggestions?
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
Catch WebSite Datas
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Berikco.
You must write a win-CGI program
The webserver will start your app, with a filename as commandline parameter.
This file is in *.INI format (mostly with .tmp extension)
in this file will be the name of the "Content File" , this holds the data of youre POST action.
Also the name of the "Output File", this file is send to the user after he pushed the button and the CGI app is finished.
Some webservers also put your form data at the end of this file.
example of html file with button
some webservers start your app with 3 parameters, the input file, the content file, and the output file
But most webservers support the first way.
Example of purebasic app "purecgi.exe "that must be placed in CGI-WIN directory on webserver, writes the name of the input file in cgitest.txt
Note the delay(20000), i needed this to be able to catch the input file, files only exist as long as CGI app is running. They are created by the server in the current TEMP dir.
example of the input file from OMNIhttpd webserver
Regards,
Berikco
<a href="http://www.benny.zeb.be[/url]
You must write a win-CGI program
The webserver will start your app, with a filename as commandline parameter.
This file is in *.INI format (mostly with .tmp extension)
in this file will be the name of the "Content File" , this holds the data of youre POST action.
Also the name of the "Output File", this file is send to the user after he pushed the button and the CGI app is finished.
Some webservers also put your form data at the end of this file.
example of html file with button
Code: Select all
CGI Example
Parameter
But most webservers support the first way.
Example of purebasic app "purecgi.exe "that must be placed in CGI-WIN directory on webserver, writes the name of the input file in cgitest.txt
Code: Select all
SourceFileName$ = ProgramParameter()
If OpenFile(1,"cgitest.txt")
WriteStringN(SourceFileName$)
CloseFile(1)
EndIf
Delay(20000)
example of the input file from OMNIhttpd webserver
Code: Select all
[CGI]
Request Protocol=HTTP/1.1
Request Method=POST
Executable Path=/CGI-WIN/purecgi.exe
Document Root=f:\webs\purebasic
Logical Path=
Physical Path=f:\webs\purebasic
Query String=
Referer=[url]http://192.168.4.202/cgi.htm[/url]
User Agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Content Type=application/x-www-form-urlencoded
Content Length=17
Content File=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\OMN20.tmp
Server Software=OmniHTTPd/2.06
Server Name=PureBasic
Server Port=80
Server Admin=[url]mailto:your@email.here">your@email.here
CGI Version=CGI/1.3a (Win)
Remote Host=
Remote Address=192.168.4.5
Authentication Method=
Authentication Realm=
Authenticated Username=
[Accept]
image/gif=Yes
image/x-xbitmap=Yes
image/jpeg=Yes
image/pjpeg=Yes
application/vnd.ms-excel=Yes
application/msword=Yes
*/*=Yes
[System]
GMT Offset=3600
Debug Mode=No
Output File=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\OMN21.tmp
Content File=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\OMN20.tmp
[Form Literal]
Parameter=This is what i typed in stringgadget
Regards,
Berikco
<a href="http://www.benny.zeb.be[/url]
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
There's also a CGI-library by El_Choni http://www.reelmediaproductions.com/pb/asmlib/cgi.zip
Timo
There's also a CGI-library by El_Choni http://www.reelmediaproductions.com/pb/asmlib/cgi.zip
Timo
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tranquil.
Thanks for fast answer but your method gives me a problem:
The GUI of my application should be displayed in a Browser-Window on a local machine and there is no CGI support or webserver installed.
Edonkey or Emule for eg uses a ED2K:// Link in the URL field wich starts the application by clicking on this link and giving parameters to it. I searched through the source-code of Emule (open source) and my registry and found some entrys. I need to check if I get it work on my own application.
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
Thanks for fast answer but your method gives me a problem:
The GUI of my application should be displayed in a Browser-Window on a local machine and there is no CGI support or webserver installed.
Edonkey or Emule for eg uses a ED2K:// Link in the URL field wich starts the application by clicking on this link and giving parameters to it. I searched through the source-code of Emule (open source) and my registry and found some entrys. I need to check if I get it work on my own application.
Mike
Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound