Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-25-2006, 04:46 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
GServer - Webserver Interaction

This is a pretty basic example..
I just thought this would be helpful for anyone wanting to do this.
HTML Code:
function onCreated() {
 temp.link = "http://www.yourwebserver.com/test.php?test=123";
 temp.req = requesturl(temp.link);
 this.catchevent(temp.req,"onReceiveData","onData");
}
function onData(obj) {
 echo("Result:" SPC obj.fulldata); // obj.<var> the vars can be found at the bottom
}
Heres my PHP Code I used..
PHP Code:
<?php
 
foreach ($_GET as $index => $val)
  $
$index $val;
 echo(
"test = $test");
?>
Quote:
obj.<var>'s

THTTPRequest (TGraalVar):
address - string (read only)
contentlanguage - string (read only)
contenttype - string (read only)
downloadcomplete - boolean (read only)
file - string (read only)
fulldata - string (read only)
lastmodified - string (read only)
port - integer (read only)
returncode - integer (read only)
returnmessage - string (read only)
server - string (read only)
Notes:
-You could proabley make some pretty interesting things, like a stats server regarding you have knowledge of php and such.
-Experiment, requesturl("http://www.google.com") or something see what happens lol..
__________________
Quote:

Last edited by fowlplay4; 09-25-2006 at 04:57 AM..
Reply With Quote
  #2  
Old 09-25-2006, 05:31 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Well.. thats.. dumb.

I can just go here:
http://www.yourwebserver.com/test.php?test=123 (example link)
and it will show me test - 123

http://www.graalx.us/gdb/

Theres my Website <--> Graal Interaction.. not source though. Only two others have it.. I think.
Reply With Quote
  #3  
Old 09-25-2006, 06:22 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
I've tried creating gserver to webserver interaction scripts before, but ideally Graal would allow socket connections or incoming HTTP connections to allow more reliable collecting of data.
Reply With Quote
  #4  
Old 09-25-2006, 10:10 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Only thing that'll suck.. is I can trigger (if seen source) to others via opening the url if you mimmick the "graal" browser or use a graal script =o
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.