Kezdőoldal » Számítástechnika » Weblapkészítés » Hogyan oldjam meg a karakter...

Hogyan oldjam meg a karakter kódolást? Hová kéne beilleszteni vagy van valami más mód rá?

Figyelt kérdés

EZT SZERETNÉM BEILLESZTENI:



<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta name='generator' content='TBDev.net' />

<meta http-equiv='Content-Language' content='en-us' />

<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-2' />



ITT A PHP FÁLJ AHOVÁ BE SZERETNÉM TENNI A KÓDOLÁST


<?


function local_user()

{

return $_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"];

}

//$FUNDS = "$2,610.31";


$SITE_ONLINE = true;

//$SITE_ONLINE = local_user();

//$SITE_ONLINE = false;


$max_torrent_size = 1000000;

$announce_interval = 60 * 30;

$signup_timeout = 86400 * 3;

$minvotes = 1;

$max_dead_torrent_time = 6 * 3600;


// Max users on site

$maxusers = 75000; // LoL Who we kiddin' here?


// Max users on site

$maxusers = 5000;


// ONLY USE ONE OF THE FOLLOWING DEPENDING ON YOUR O/S!!!

#$torrent_dir = "/var/tb/torrents"; # FOR UNIX ONLY - must be writable for httpd user

$torrent_dir = "torrents"; # FOR WINDOWS ONLY - must be writable for httpd user


$files_dir = "files";


# the first one will be displayed on the pages

$announce_urls = array();

$announce_urls[] = "http://........./announce.php";



if ($_SERVER["HTTP_HOST"] == "") // Root Based Installs Comment Out if in Sub-Dir

$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"]; // Comment out for Sub-Dir Installs

$BASEURL = "http://" . $_SERVER["HTTP_HOST"]; // Comment out for Sub-Dir Installs


//$BASEURL = 'http://domain.com'; // Uncomment for Sub-Dir Installs - No Ending Slash


// Set this to your site URL... No ending slash!

$DEFAULTBASEURL = "http://...........net";


//set this to true to make this a tracker that only registered users may use

$MEMBERSONLY = true;


//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...

//set this to something high if you don't require this feature

$PEERLIMIT = 50000;


// Email for sender/return path.

$SITEEMAIL = "noreply@........net"; # Site's Default Email


$SITENAME = "......"; # Add site name here


$autoclean_interval = 900;

$pic_base_url = "/pic/";

$maxloginattempts = 4; // change this whatever u want. if u dont know what is this, leave it default



require_once("secrets.php");

require_once("cleanup.php");


//---------------------------------

//---- Max. Sysops Added by D3SI

//---------------------------------


function maxsysop () {

global $CURUSER;

// Check Staff Names

$lmaxclass = 6;

$lsysopnames = array("D3SI","admin"); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("adminname1","adminname2","adminname3","adminname4","so far")

if ($CURUSER["class"] >= $lmaxclass)

if (!in_array($CURUSER["username"], $lsysopnames, true)) { // true for strict comparison

$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();

write_log($msg);

mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " .sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);

stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");

}

// Check Staff IDS

define ('UC_STAFF', 6); // Minumum Staff Level (50= UC_ SysOp)

if ($CURUSER['class'] >= UC_STAFF) {

$allowed_ID = array(1,); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(1,2,3,4,5))

if (!in_array((int)$CURUSER['id'], $allowed_ID, true)) { // true for strict comparison

$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();

write_log($msg);

stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");

}

}

}


//---------------------------------

//---- Max. Sysops Added by D3SI

//---------------------------------


//Do not modify -- versioning system

//This will help identify code for support issues at tbdev.net

define ('TBVERSION','TBDEV.NET-12-09-05');


/**** validip/getip courtesy of manolete <manolete@myway.com> ****/


function validip($ip) {

if($ip==long2ip(ip2long($ip)))

{

// reserved IANA IPv4 addresses

// [url=http://www.iana.org/assignments/ipv4-address-space%5dhttp://www.iana.org/assignments/ipv4-address-space%5b/url%5d

$reserved_ips = array (

array(4294967296,4345298943), // array('0.0.0.0','2.255.255.255'),

array(4462739456,4479516671), // array('10.0.0.0','10.255.255.255'),

array(6425673728,6442450943), // array('127.0.0.0','127.255.255.255'),

array(2886729728,2887778303), // array('172.16.0.0','172.31.255.255'),

array(3221225984,3221226239), // array('192.0.2.0','192.0.2.255'),

array(3232235520,3232301055), // array('192.168.0.0','192.168.255.255'),

array(4294967040,4294967295), // array('255.255.255.0','255.255.255.255')

);

$ip=ip2ulong($ip);

foreach ($reserved_ips as $r)

if (($ip >= $r[0]) && ($ip <= $r[1])) return false;

return true;

}

else return false;

}


//=== new and faster get IP function by Pandora :D

function getip()

{

$ip = $_SERVER['REMOTE_ADDR'];


if (isset($_SERVER['HTTP_VIA']))

{

$forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';


if ($forwarded_for != $ip)

{

$ip = $forwarded_for;

$nums = sscanf($ip, '%d.%d.%d.%d');

if ($nums[0] === null ||

$nums[1] === null ||

$nums[2] === null ||

$nums[3] === null ||

$nums[0] == 10 ||

($nums[0] == 172 && $nums[1] >= 16 && $nums[1] <= 31) ||

($nums[0] == 192 && $nums[1] == 168) ||

$nums[0] == 239 ||

$nums[0] == 0 ||

$nums[0] == 127)

$ip = $_SERVER['REMOTE_ADDR'];

}

}


return $ip;

}


function dbconn($autoclean = false)

{

global $mysql_host, $mysql_user, $mysql_pass, $mysql_db;


if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass))

{

switch (mysql_errno())

{

case 1040:

case 2002:

if ($_SERVER[REQUEST_METHOD] == "GET")

die("<html><head><meta http-equiv=refresh content="5 $_SERVER[REQUEST_URI]"></head><body><table border=0 width=100% height=100%><tr><td><h3 align=center>A szerver túl van terhelve várj egy kicsit!</h3></td></tr></table></body></html>");

else

die("Too many users. Please press the Refresh button in your browser to retry.");

default:

die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error());

}

}

mysql_select_db($mysql_db)

or die('dbconn: mysql_select_db: ' + mysql_error());


userlogin();


if ($autoclean)

register_shutdown_function("autoclean");

}



function userlogin() {

global $SITE_ONLINE;

unset($GLOBALS["CURUSER"]);


$ip = getip();

$nip = ip2long($ip);

$res = mysql_query("SELECT * FROM bans WHERE $nip >= first AND $nip <= last") or sqlerr(__FILE__, __LINE__);

if (mysql_num_rows($res) > 0)

{

header("HTTP/1.0 403 Forbidden");

print("<html><body><h1>403 Forbidden</h1>Unauthorized IP address.</body></html>\n");

die;

}


if (!$SITE_ONLINE || empty($_COOKIE["uid"]) || empty($_COOKIE["pass"]))

return;

$id = 0 + $_COOKIE["uid"];

if (!$id || strlen($_COOKIE["pass"]) != 32)

return;

$res = mysql_query("SELECT * FROM users WHERE id = $id AND enabled='yes' AND status = 'confirmed'");// or die(mysql_error());

$row = mysql_fetch_array($res);

if (!$row)

return;

$sec = hash_pad($row["secret"]);

if ($_COOKIE["pass"] !== md5($row["passhash"].$_SERVER["REMOTE_ADDR"]))

return;

mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip)." WHERE id=" . $row["id"]);// or die(mysql_error());

$row['ip'] = $ip;

$GLOBALS["CURUSER"] = $row;

}


function autoclean() {

global $autoclean_interval;


$now = time();

$docleanup = 0;


$res = mysql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'");

$row = mysql_fetch_array($res);

if (!$row) {

mysql_query("INSERT INTO avps (arg, value_u) VALUES ('lastcleantime',$now)");

return;

}

$ts = $row[0];

if ($ts + $autoclean_interval > $now)

return;

mysql_query("UPDATE avps SET value_u=$now WHERE arg='lastcleantime' AND value_u = $ts");

if (!mysql_affected_rows())

return;


docleanup();

}


function unesc($x) {

if (get_magic_quotes_gpc())

return stripslashes($x);

return $x;

}


function mksize($bytes)

{

if ($bytes < 1000 * 1024)

return number_format($bytes / 1024, 2) . " kB";

elseif ($bytes < 1000 * 1048576)

return number_format($bytes / 1048576, 2) . " MB";

elseif ($bytes < 1000 * 1073741824)

return number_format($bytes / 1073741824, 2) . " GB";

else

return number_format($bytes / 1099511627776, 2) . " TB";

}


function mksizeint($bytes)

{

$bytes = max(0, $bytes);

if ($bytes < 1000)

return floor($bytes) . " B";

elseif ($bytes < 1000 * 1024)

return floor($bytes / 1024) . " kB";

elseif ($bytes < 1000 * 1048576)

return floor($bytes / 1048576) . " MB";

elseif ($bytes < 1000 * 1073741824)

return floor($bytes / 1073741824) . " GB";

else

return floor($bytes / 1099511627776) . " TB";

}


function deadtime() {

global $announce_interval;

return time() - floor($announce_interval * 1.3);

}


function mkprettytime($s) {

if ($s < 0)

$s = 0;

$t = array();

foreach (array("60:sec","60:min","24:hour","0:day") as $x) {

$y = explode(":", $x);

if ($y[0] > 1) {

$v = $s % $y[0];

$s = floor($s / $y[0]);

}

else

$v = $s;

$t[$y[1]] = $v;

}


if ($t["day"])

return $t["day"] . "d " . sprintf("%02d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]);

if ($t["hour"])

return sprintf("%d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]);

// if ($t["min"])

return sprintf("%d:%02d", $t["min"], $t["sec"]);

// return $t["sec"] . " secs";

}


function mkglobal($vars) {

if (!is_array($vars))

$vars = explode(":", $vars);

foreach ($vars as $v) {

if (isset($_GET[$v]))

$GLOBALS[$v] = unesc($_GET[$v]);

elseif (isset($_POST[$v]))

$GLOBALS[$v] = unesc($_POST[$v]);

else

return 0;

}

return 1;

}


function tr($x,$y,$noesc=0) {

if ($noesc)

$a = $y;

else {

$a = htmlspecialchars($y);

$a = str_replace("\n", "<br />\n", $a);

}

print("<tr><td class="heading" valign="top" align="right">$x</td><td valign="top" align=left>$a</td></tr>\n");

}


function validfilename($name) {

return preg_match('/^[^\0-\x1f:\\\\\/?*\xff#<>|]+$/si', $name);

}


function validemail($email) {

return preg_match('/^[\w.-]+@([\w.-]+\.)+[a-z]{2,6}$/is', $email);

}


function sqlesc($x) {

return "'".mysql_real_escape_string($x)."'";

}


function sqlwildcardesc($x) {

return str_replace(array("%","_"), array("\\%","\\_"), mysql_real_escape_string($x));

}


function urlparse($m) {

$t = $m[0];

if (preg_match(',^\w+://,', $t))

return "<a href="$t">$t</a>";

return "<a href="http://$t">$t</a>";

}


function parsedescr($d, $html) {

if (!$html)

{

$d = htmlspecialchars($d);

$d = str_replace("\n", "\n<br>", $d);

}

return $d;

}


function stdhead($title = "", $msgalert = true) {

global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $pic_base_url;


if (!$SITE_ONLINE)

die("Az oldal szünetel!<br>");


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/>;

//header("Pragma: No-cache");

if ($title == "")

$title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":'');

else

$title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " . htmlspecialchars($title);

if ($CURUSER)

{

$ss_a = @mysql_fetch_array(@mysql_query("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));

if ($ss_a) $ss_uri = $ss_a["uri"];

}

if (!$ss_uri)

{

($r = mysql_query("SELECT uri FROM stylesheets WHERE id=1")) or die(mysql_error());

($a = mysql_fetch_array($r)) or die(mysql_error());

$ss_uri = $a["uri"];

}

if ($msgalert && $CURUSER)

{

$res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");

$arr = mysql_fetch_row($res);

$unread = $arr[0];

}

?>

<html><head>

<script type="text/javascript" src="./java_klappe.js"></script>

<title><?= $title ?></title>

<link rel="stylesheet" href="<?=$ss_uri?>" type="text/css">

</head>

<body>


<table width=100% cellspacing=0 cellpadding=0 style='background: transparent'>

<tr>

<td class=clear width=49%>

</td>

<td class=clear>

<div align=center>

<img src="<?=$pic_base_url?>logo.gif" align=center>

</div>

</td>

<td class=clear width=49% align=right>


</td>

</tr></table>


<!-- /////// some vars for the statusbar;o) //////// -->


<? if ($CURUSER) { ?>


<?


$datum = getdate();


$datum[hours] = sprintf("%02.0f", $datum[hours]);


$datum[minutes] = sprintf("%02.0f", $datum[minutes]);


$uped = mksize($CURUSER['uploaded']);


$downed = mksize($CURUSER['downloaded']);


if ($CURUSER["downloaded"] > 0)


{


$ratio = $CURUSER['uploaded'] / $CURUSER['downloaded'];


$ratio = number_format($ratio, 3);


$color = get_ratio_color($ratio);


if ($color)


$ratio = "<font color=$color>$ratio</font>";


}


else


if ($CURUSER["uploaded"] > 0)


$ratio = "Inf.";


else


$ratio = "---";



if ($CURUSER['donor'] == "yes")


$medaldon = "<img src=pic/star.gif alt=donor title=donor>";



if ($CURUSER['warned'] == "yes")


$warn = "<img src=pic/warned.gif alt=warned title=warned>";



//// check for messages //////////////////


$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND location IN ('in', 'both')") or print(mysql_error());


$arr1 = mysql_fetch_row($res1);


$messages = $arr1[0];


$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND location IN ('in', 'both') AND unread='yes'") or print(mysql_error());


$arr1 = mysql_fetch_row($res1);


$unread = $arr1[0];


$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE sender=" . $CURUSER["id"] . " AND location IN ('out', 'both')") or print(mysql_error());


$arr1 = mysql_fetch_row($res1);


$outmessages = $arr1[0];


$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");


$arr1 = mysql_fetch_row($res1);


$unread = $arr1[0];


if ($unread)


$inboxpic = "<img height=14px style=border:none alt=inbox title='inbox (


2011. máj. 7. 21:36
 1/1 anonim ***** válasza:

A lekérdezések előtt használd ezt:

[link]

2011. máj. 8. 11:54
Hasznos számodra ez a válasz?

Kapcsolódó kérdések:





Minden jog fenntartva © 2024, www.gyakorikerdesek.hu
GYIK | Szabályzat | Jogi nyilatkozat | Adatvédelem | Cookie beállítások | WebMinute Kft. | Facebook | Kapcsolat: info(kukac)gyakorikerdesek.hu

A weboldalon megjelenő anyagok nem minősülnek szerkesztői tartalomnak, előzetes ellenőrzésen nem esnek át, az üzemeltető véleményét nem tükrözik.
Ha kifogással szeretne élni valamely tartalommal kapcsolatban, kérjük jelezze e-mailes elérhetőségünkön!