![]() |
Exporting Variable
Ok, I dont know if this is the right section technically. I was wondering if it is possible to pull the value and name of a gs2 variable and display the name and value on a website? Website is in php, but if I have to use a different language I can.
|
Getting the variable name, without having it saved as a string will not work. (Unless GS2 saves it as a string somewhere already, of course)
|
You can use requesturl and send that value to your php server using get requests.
I.e: PHP Code:
|
If you have a lot of data to send, you can also use this to send it as POST data.
|
So i just make that ="somevalue" the value of the var correct?
And I would probably grab maybe 3-4 things seperately, so this should work I think. |
Quote:
If, for example, you wanted a live feed of the number of players on your server, you could create a DB NPC like this: PHP Code:
PHP Code:
|
your comments ran off the snippet (sry if spelt wrong, not in the right mind if that makes sense to u over 21 people).
|
Quote:
|
Its that 23 year old "alcohol" problem, my bad, seriously. I would delete my post but then urs wouldnt make 0 sense.
|
I actually just realized tonight that I dont need to send the variable to a webpage when someone goes to the webpage technically.
Is there a way I can get the webpage to retrieve a variable on a graal server when the webpage opens, no matter how it actually opens. Like, if i search my page in google, then go to it, i would like the information on the webpage to be up to date with the variable on the server still. |
Quote:
|
I have no idea how to get graal to just periodically pass something to my website that way without hitting "open url" in graal first, that way it can send the variable to the site unless requesturl works without doing that, then i just didnt know exactly how requesturl works.
|
Since it's kind of on topic, is there a way to send a variable from a site to a server?
|
We don't allow binding of sockets for TSocket except in very special cases. So it's technically possible (we run some graal webservers) but is not enabled because of security reasons. It's however possible to open a permanent TSocket to your webserver or whatever, you will have to request to get it enabled for your server (including destination address and port number).
|
All times are GMT +2. The time now is 02:59 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.