Просмотр файла MyLounge/myred/dyn.php

Размер файла: 1.67Kb
<?php
include("include/vars.php");
require("include/functions.php");
$lang=setlanguage();
require("language/$lang");
$menu=setmenu();

// Dynamically change ip-address to run a webserver from home
// Call this script like dyn.php?user=username&pass=password[&dir=/directory/link.html] (optional)

if (!isset($user) || !isset($pass)) {
$main="<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"640\" align=\"center\">
<tr>
<td align=\"center\"><b>$text_90</b></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>$text_89</td>
</tr>
</table>";

$template = new MyredTemplate("template/template.html");
$template->assign("TITLE", $pagetitle);
$template->assign("MENU", $menu);
$template->assign("MAIN", $main);
$template->myred_print() or die($template->error);
exit;
}
// Check the user
$dyn_query=mysql_query("SELECT * FROM $redir_table WHERE host='$user' AND passwd='$pass'") or die (mysql_error());
if (mysql_num_rows($dyn_query) != 1) {
	errormsg($text_91);
	exit;
}
$rem_host = "http://";
$rem_host .= $REMOTE_ADDR;
if (isset($dir)) {
	$rem_host .= $dir;
	}
mysql_query("UPDATE $redir_table SET url='$rem_host' WHERE host='$user' AND passwd='$pass'") or die (mysql_error());

$main="<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"500\" align=\"center\">
<tr>
<td align=\"center\"><b>$text_92</b></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>$text_93<br><br><b>$rem_host</b>
</td>
</tr>
</table>";

$template = new MyredTemplate("template/template.html");
$template->assign("TITLE", $pagetitle);
$template->assign("MENU", $menu);
$template->assign("MAIN", $main);
$template->myred_print() or die($template->error);
exit;
?>