Computer Science Canada

linking a program

Author:  beedub [ Sun Jun 01, 2003 9:27 am ]
Post subject:  linking a program

is there any way to link a program. to something on to the internet??/ lets say a text box

Author:  JSBN [ Sun Jun 01, 2003 9:45 am ]
Post subject: 

yes there is hold on i'll get you the code

Net.OpenURLConnection Part of Net module

Syntax   Net.OpenURLConnection (urlAddr : string) : int
Description   Attempts to open a http connection to pthe URL (Universal Resource Locator) specified by the urlAddr.
If successful, Net.OpenURLConnection returns a network stream descriptor which can be used with the get statement and eof function to read the web page located at the URL.

The program will wait for an indeterminate amount of time to make the connection. If it fails, it will return a non-positive value.

Details   The Net module requires a TCP/IP stack to be installed and operating in order to function. It does not communicate using any other protocols
It is possible for Firewalls to interfere with the actions of the Net module, preventing connections from taking place.

Example   The following program prints out the contents of the file specified by the user.

        var url : string
        put "Enter the URL to load: " ..
        get url
        var netStream : int
        var line : string
        netStream := Net.OpenURLConnection (url)
        if netStream <= 0 then
            put "Unable to connect to ", url
        end if
            exit when eof (netStream)
            get : netStream, line
            put line
        end loop
        Net.CloseConnection (netStream)
Status   Exported qualified.
This means that you can only call the function by calling Net.OpenURLConnection, not by calling OpenURLConnection.

See also   Net.CloseConnection.

To find moer net commands, go in turing 4.04 and press f10 click on the index tab, and type 'net'. this will give you a list of all the net commands

Author:  beedub [ Sun Jun 01, 2003 3:23 pm ]
Post subject: 

is there any way to to put something in a text field tho?? as if i were copying and pasting the stuff from turing into the text field.

Author:  Andy [ Sun Jun 01, 2003 3:43 pm ]
Post subject: 

hey dude, i just realized something, i can make a hotmail hacker...

Author:  beedub [ Sun Jun 01, 2003 5:02 pm ]
Post subject: 

nice wanna send ...??

Author:  Tony [ Sun Jun 01, 2003 7:40 pm ]
Post subject: 

well you could open CGI/PHP page with values passed in


where value=blah is generated by turing.

Author:  PaddyLong [ Sun Jun 01, 2003 7:55 pm ]
Post subject: 

I don't think that would work Tony... not unless on the webpage they're using something like php and for their text box they have it set to something like

<input type="text" name="blah" value="<?php print($HTTP_GET_VARS['blah']); ?>">

which they definately wouldn't Razz

but I don't think you can just fill in a text box on the spot like that by adding a url variable

Author:  Dan [ Sun Jun 01, 2003 11:11 pm ]
Post subject: 

ah...the way most php progames get data for pass is from a html fourm with sends it to the php porgame in the format that tony posted. so yes toyns way could wrok, i posted a progame to login in to utipoia game from turing a while ago using the same method.