Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 linking a program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
beedub




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
JSBN




PostPosted: Sun Jun 01, 2003 9:45 am   Post subject: (No subject)

yes there is hold on i'll get you the code
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
            return
        end if
        loop
            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
beedub




PostPosted: Sun Jun 01, 2003 3:23 pm   Post subject: (No 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.
Andy




PostPosted: Sun Jun 01, 2003 3:43 pm   Post subject: (No subject)

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




PostPosted: Sun Jun 01, 2003 5:02 pm   Post subject: (No subject)

nice wanna send ...??
Tony




PostPosted: Sun Jun 01, 2003 7:40 pm   Post subject: (No subject)

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

"www.compsci.ca/randompage.php?value=blah"

where value=blah is generated by turing.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
PaddyLong




PostPosted: Sun Jun 01, 2003 7:55 pm   Post subject: (No 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
Dan




PostPosted: Sun Jun 01, 2003 11:11 pm   Post subject: (No 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.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: