Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   GServer - Webserver Interaction (https://forums.graalonline.com/forums/showthread.php?t=68941)

fowlplay4 09-25-2006 04:46 AM

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..

KuJi 09-25-2006 05:31 AM

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.

Skyld 09-25-2006 06:22 PM

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.

KuJi 09-25-2006 10:10 PM

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


All times are GMT +2. The time now is 12:28 PM.

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