} else {
        $Host[0] = $Host[0][0];
    }
    $Socket = @fsockopen($SSLAdd . $Host[0], $Port, $Dummy1, $Dummy2, 1);
    // this is needed to connect to another server.
    if ($Socket) {
        fputs($Socket, "{$Method} /{$Host['1']} HTTP/1.1\r\n" . "Host: {$Host['0']}\r\n" . "Content-type: application/x-www-form-urlencoded\r\n" . "User-Agent: Opera/9.01 (Windows NT 5.1; U; en)\r\n" . "Accept-Language: de-DE,de;q=0.9,en;q=0.8\r\n" . "Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1\r\n" . "Content-length: " . strlen($PostData) . "\r\n" . "Connection: close\r\n" . "\r\n" . $PostData);
        $Tme = time();
        while (!feof($Socket) && $Tme + 30 > time()) {
            $Res = $Res . fgets($Socket, 256);
        }
        fclose($Socket);
    }
    $Res = explode("\r\n\r\n", $Res, 2);
    return $Res[1];
}
// Dont really know what all that above does but it works.
// You can use this function anywhere in your php files. Below is a example of how to do it.
$primurl = "";
// this would be the address that llRequestURL() generated and said in local chat for you.
$data = "FARTAPI=fart=Christina.Vortex";
// This is data we want to send. Remember you can change any part of this.
// Your welcome to leave as is if testing it on ZetaWorlds, Next Reality or Great Canadian Grid since i have the same name on all of those grids.
// Now lets send that info to the script above and display the results in the browser
echo senddata($primurl, $data);
// its that simple.
// now open this page in your browser and watch the magic in world.
// DISCLAIMER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// This and the included lsl file is just a tutorial to help other opensim/sl users know how to send data to a prim from a website.
// You are very welcome to use and mod this and the included lsl all you want, just please dont redistrube this tutorial as your own.
// Credit where credit is due.
Example #2
0
    flush();
}
function actform()
{
    $PHPSELF = isset($_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : $PHP_SELF;
    $actform = implode("", file("actform.inc.txt"));
    eval("\$actform = \"{$actform}\";");
    return $actform;
}
if (isset($_REQUEST["name"])) {
    $name = $_REQUEST["name"];
}
if (isset($_REQUEST["key"])) {
    $key = $_REQUEST["key"];
}
if (empty($name) or empty($key)) {
    senddata("", true);
    exit;
}
$mysql =& new mysql($cfg["mysql"]["host"], $cfg["mysql"]["user"], $cfg["mysql"]["pass"], $cfg["mysql"]["db"]);
if (!$mysql->connect()) {
    senddata("<b>Fatal error: Could not connect to database! Please tell the webmaster about this problem.</b>");
    exit;
}
$registry =& new registry(&$mysql, $cfg["registry"]);
if (!$registry->activateUser($name, $key)) {
    senddata("<p><b>The key is wrong or the user does not exist!</b></p>", true);
    exit;
}
senddata("<p>The username \"" . $name . "\" has been successfully activated! You can use it now in the chat.</p>");
Example #3
0
<?php 
    echo $data;
    if ($loginform) {
        echo loginform();
    }
    ?>
</div></body></html>
<?php 
    flush();
}
function loginform()
{
    $ACTION = "cp.php";
    $loginform = implode("", file("loginform.inc.txt"));
    $loginform = str_replace("\"", "\\\"", $loginform);
    eval("\$loginform = \"{$loginform}\";");
    return $loginform;
}
$mysql =& new mysql($cfg["mysql"]["host"], $cfg["mysql"]["user"], $cfg["mysql"]["pass"], $cfg["mysql"]["db"]);
if (!$mysql->connect()) {
    senddata("<b>Fatal error: Could not connect to database! Please tell the webmaster about this problem.</b>");
    exit;
}
$session =& new session(&$mysql, $cfg["usercp"]);
if ($session->session_start()) {
    header("Location: cp.php");
    flush();
    exit;
}
senddata("", true);
Example #4
0
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>YaCE 3 - Smilie list</title>
</head>
<body>
<?php 
    echo $data;
    ?>
</body>
</html>
<?php 
    flush();
}
$mysql =& new mysql($cfg["mysql"]["host"], $cfg["mysql"]["user"], $cfg["mysql"]["pass"], $cfg["mysql"]["db"]);
if (!$mysql->connect()) {
    senddata("<b>Fatal error: Could not connect to database! Please tell the webmaster about this problem.</b>");
    exit;
}
$res = $mysql->query("SELECT * from " . $cfg["table"]["replaces"]);
if ($res === false) {
    senddata("<p><b>There are no replaces.</b></p>");
    exit;
}
$data = "<center><h3>YaCE 3 - Smilie list</h3>\n<TABLE style=\"FONT-SIZE: 10pt; FONT-FAMILY: Verdana; BORDER-COLLAPSE: collapse\" borderColor=\"#AAAAAA\" cellSpacing=\"0\" cellPadding=\"0\" width=\"98%\" border=\"1\">\n<tr><td><b>Pattern</b></td><td><b>Replace</b></td></tr>";
while ($row = mysql_fetch_array($res)) {
    $data .= "<tr><td width=\"400\">" . $row[0] . "</td><td width=\"400\">" . $row[1] . "</td></tr>\r\n";
}
$data .= "</table></center>";
senddata($data);