You must be logged in to do that.

GetUrlText

GetUrlText
string GetUrlText(string url)

Documentation

Attempts to connect to the a given URL, and returns the contents. If it fails, it will instead return that site's Error 404 (File not Found) message. Could possibly be used in conjunction with a PHP-enabled page, allowing cool stuff like a dynamic online high-score chart, or something. Also, I'm guessing if a webhost is completely down, Verge will crash hard.

Example Usage

// Log the current VergeC functions from vecna's website.
Log (GetUrlText("http://vecna.verge-rpg.com/v3vergec.txt"));

string username, password;
// Advanced Functionality: Send username and password.
if (!strcmp(GetUrl("http://127.0.0.1/login.php?username="+username+"&password="+password), "Okay, you've connected successfully.")
{
	// Let the clients who successfully login continue.
	SocketSendString(i, "RPL_LOGINSUCCESSFUL");
}
else
{
	// Disconnect clients who fail at the login.
	SocketSendString(i, "ERR_LOGINFAILURE");
	SocketClose(i);
}
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.