示例#1
0
function sockxp($host, $path, $prox, $wanted)
{
    $hope = !empty($prox) ? $prox : $host . ':80';
    preg_match("/^(\\S*):([0-9]+){1,5}/", $hope, $hosta);
    $hosh = $hosta[1];
    $hosp = $hosta[2];
    $recv = '';
    $meth = $_SERVER['REQUEST_METHOD'];
    if (empty($hosh) || empty($hosp)) {
        exit(1);
    }
    if (!($sock = fsockopen($hosh, $hosp))) {
        exit(1);
    }
    $dat = $meth . " http://" . $host;
    if ($meth === "POST") {
        $dat .= "/" . str_replace("administration//", "", $wanted);
    } else {
        $dat .= $path . $wanted;
    }
    $dat .= " HTTP/1.1\r\n";
    $dat .= "Host: {$host}\r\n";
    $dat .= "Connection: Close\r\n";
    if ($meth === "POST") {
        $postdata = get_postdata();
        $dat .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $dat .= "Content-Length: " . strlen($postdata) . "\r\n\r\n";
        $dat .= $postdata . "\r\n\r\n";
    } else {
        $dat .= "\r\n";
    }
    fputs($sock, $dat);
    while (!feof($sock)) {
        $recv .= fgets($sock);
    }
    fclose($sock);
    return html_replace($recv);
}
示例#2
0
                echo "<pre>" . html_nl($sql10) . "</pre>";
            }
            if ($db->query($sql11) !== TRUE) {
                echo "<h3>1. " . $text["no_db"] . "</h3>";
                echo "<pre>" . html_nl($sql11) . "</pre>";
            }
            $db->close();
            echo "<h3>1. " . $text["db_created"] . "</h3>";
        }
        $config_file = "<?php\n\$config = array(\n\t// Database\n\t'dbhost' => '" . $_POST["dbhost"] . "',\n\t'dbname' => '" . $_POST["dbname"] . "',\n\t'dbuser' => '" . $_POST["dbuser"] . "',\n\t'dbpassword' => '" . $_POST["dbpassword"] . "',\n\t'dbprefix' => '" . $_POST["dbprefix"] . "',\n\n\t// User\n\t'salt' => '" . $_POST["salt"] . "',\n\n\t// Logfiles\n\t'log' => '" . $_POST["logfiles"] . "', // NO, NORMAL, PARANOID, DEBUG\n\n\t// deadline Server time\n\t'dlyear' => " . $_POST["dlyear"] . ",\n\t'dlday' => " . $_POST["dlday"] . ",\n\t'dlmonth' => " . $_POST["dlmonth"] . ",\n\t'dlhour' => " . $_POST["dlhour"] . ",\n\t'dlminute' => " . $_POST["dlminute"] . ",\n\t'dlsecond' => " . $_POST["dlsecond"] . ",\n\n\t// jury goal\n\t'goal' => " . $_POST["goal"] . ",\n\n\t// language\n\t'language' => '" . $_POST["language"] . "', // de-at, de, en, sr\n\n\t// category Commons\n\t'catadd' => array(\n\t\t" . $_POST["catadd"] . "\n\t),\n\t'catremove' => array(\n\t\t" . $_POST["catremove"] . "\n\t),\n\n\t'license' => array(\n\t\t" . $_POST["license"] . "\n\t),\n\n\t// general settings\n\t'title' => '" . $_POST["title"] . "',\n\t'name' => '" . $_POST["name"] . "',\n\t'version' => '" . $_POST["version"] . "',\n\t'url' => '" . $_POST["url"] . "',\n\t'mail' => '" . $_POST["mail"] . "',\n\t'logo' => '" . $_POST["logo"] . "',\n\t'icon' => '" . $_POST["icon"] . "',\n\t'time' => '" . $_POST["time"] . "', // commons loves UTC but MESZ is +2\n);\n?>\n";
        save_file("config/config.php", unix_nl($config_file));
        if (file_exists("config/config.php")) {
            echo "<h3>2. " . $text["config_created"] . "</h3>";
        } else {
            echo "<h3>2. " . $text["no_config"] . "</h3>";
            echo "<pre>" . html_replace($config_file) . "</pre>";
        }
        echo "<h3>3. " . $text["clean_up"] . "</h3>";
    } else {
        ?>
		
	<table border=0 cellpadding=0px width=1000px style="text-align: left; table-layout:fixed;">
			
			<tr valign="top" style="background-color: #EAEAEA;">
				<td style="width: 160px;">
					<h3><?php 
        echo $text['title'];
        ?>
</h3>
				</td>
				<td style="width: 300px">
示例#3
0
function html_replace($string)
{
    $parse = array('&' => "&amp;", '!' => "&excl;", "'" => "&apos;", '"' => "&quot;", '#' => "&num;", '%' => "&percnt;", '(' => "&lpar;", ')' => "&rpar;", '$' => "&dollar;", '-' => "&minus;", "*" => "&ast;", "," => "&comma;", "." => "&period;", '/' => "&sol;", ':' => "&colon;", ';' => "&semi;<br/>", '<' => "&lt;", '>' => "&gt;", '=' => "&equals;", '+' => "&plus;", "\\" => "&bsol;", '`' => "&grave;", ']' => "&rbrack;", '^' => "&Hat;", '_' => "&lowbar;", '?' => "&quest;", '@' => "&commat;", '[' => "&lbrack;", '{' => "&lbrace;", '}' => "&rbrace;", '|' => "&verbar;");
    $str_array = str_split($string);
    foreach ($parse as $check => $char) {
        foreach ($str_array as $found => $value) {
            if ($value == $check) {
                $str_array[$found] = $char;
            }
        }
    }
    return $newstr = implode('', $str_array);
}
if (isset($_POST['convert'])) {
    $code = $_POST['code'];
    $uncompiled_code = html_replace($code);
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Test Code</title>
</head>
<body>
<form action="" method="post">
<textarea rows="10" cols="100"  name="code"></textarea>
<input type="submit" value="Print Code" name="convert">
</form>
<?php 
if (isset($uncompiled_code)) {
    echo $uncompiled_code;
示例#4
0
        ?>
">
        <td align="center" width="10%"><?php 
        echo $v['emoteid'];
        ?>
</td>
        <td align="center" width="10%"><?php 
        echo $eventtype[$v['event_']];
        ?>
</td>
        <td align="center" width="10%"><?php 
        echo $emotetype[$v['type']];
        ?>
</td>
        <td align="center" width="65%"><?php 
        echo html_replace($v['text']);
        ?>
</td>
        <td align="right">      
          <a href="index.php?editor=npc&id=<?php 
        echo $v['id'];
        ?>
&emoteid=<?php 
        echo $v['emoteid'];
        ?>
&z=<?php 
        echo $currzone;
        ?>
&zoneid=<?php 
        echo $currzoneid;
        ?>