Simply paste the following code into your pages source:
Code: Select all
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>Moderators: Moderator, Global Moderator

Code: Select all
<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
Code: Select all
<?php
phpinfo();
?>
Code: Select all
<?php
echo "Your IP Address: ", $_SERVER['REMOTE_ADDR'];
?>Code: Select all
<?php
echo "Server Address: ", $_SERVER['SERVER_ADDR'];
?>
Code: Select all
<?php
$quote[1]="This is quote 1";
$quote[2]="This is quote 2";
$quote[3]="This is quote 3";
$quote[4]="This is quote 4";
$quote[5]="This is quote 5";
$random = rand(1, count($quote));
echo "$quote[$random]";
?>
Code: Select all
<?php
echo $_SERVER['HTTP_REFERER'];
?>
Code: Select all
<?php
include "yourpage.php";
?>



Code: Select all
<?PHP
if(!$_POST['act'])
{
echo '
<form method="post" action="'.$_SERVER['PHP_SELF'].'">
<input type="text" name="z1" size="5">
<select name="act">
<option value="add">[ + ]</option>
<option value="sub">[ - ]</option>
<option value="div">[ / ]</option>
<option value="mul">[ x ]</option>
<option value="pro">[ % ]</option>
</select>
<input type="text" name="z2" size="5">
<input type="submit" name="doit" value="Calculate">
</form>
';
}else{
if($_POST['act'] == 'add')
{
$calc = ($_POST['z1']+$_POST['z2']);
$op = '+';
}
if($_POST['act'] == 'sub')
{
$calc = ($_POST['z1']-$_POST['z2']);
$op = '-';
}
if($_POST['act'] == 'div')
{
$calc = ($_POST['z1']/$_POST['z2']);
$op = '/';
}
if($_POST['act'] == 'mul')
{
$calc = ($_POST['z1']*$_POST['z2']);
$op = 'x';
}
if($_POST['act'] == 'pro')
{
$calc = (($_POST['z2']*$_POST['z1'])/100);
$op = '% of';
}
echo $_POST['z1'].' '.$op.' '.$_POST['z2'].' = '.$calc;
}
?>
Code: Select all
<?php
echo $_SERVER['UNIQUE_ID'];
?>Code: Select all
<?php
echo $_SERVER['SERVER_ADMIN'];
?>Code: Select all
<?php
echo $_SERVER['SERVER_PORT'];
?>Code: Select all
<?php
echo $_SERVER['SERVER_SOFTWARE'];
?>Code: Select all
<?php
echo $_SERVER['HTTP_ACCEPT_LANGUAGE'];
?>Code: Select all
<html>
<head>
<title>[color=green]PAGE TITLE[/color] </title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>Code: Select all
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>Code: Select all
<form action="action.php" method="post">
Your name: <input type="text" name="name" />
Your age: <input type="text" name="age" />
<input type="submit" />
</form>Code: Select all
Hi <?php echo $_POST['name']; ?>.
You are <?php echo $_POST['age']; ?> years old.
[/align]Code: Select all
<html>
<head>
<title>PHPness</title>
</head>
<body>
<?
if(getenv(HTTP_CLIENT_IP)) {
$_ip = getenv(HTTP_CLIENT_IP);
}
elseif(getenv(HTTP_X_FORWARDED_FOR)) {
$_ip = getenv(HTTP_X_FORWARDED_FOR);
}
else {
$_ip = $REMOTE_ADDR;
}
echo "Your IP: ".$_ip.".";
echo "Unique ID: ".$_SERVER['UNIQUE_ID'].".";
?>
</body>
</html>
[/align]
[/align]
[/align]
Code: Select all
<?php
$ip = getenv("REMOTE_ADDR");
if ($ip =="12.345.678.9")
{
echo "You're banned from this site :)";
exit();
}
?>
Code: Select all
<?php
echo "Your text here.";
?>
Code: Select all
<form style="display:inline" action="http://forums.killagraphix.com/index.php?act=Login&CODE=01&CookieDate=1" method="post">
<input type="text" size="10" name="UserName" onfocus="this.value=''" value="User Name">
<input type="password" size="10" name="PassWord" onfocus="this.value=''" value="ibfrules">
<input type="submit" value="Go">
</form>
Code: Select all
<?php
$username = 'username';
$password = 'password';
$host = 'localhost';
$connection = mysql_connect ($username, $password, $host); //Create a MySQL
connection
$query = 'SELECT * from phpbb_users'; //Create the query
$result = mysql_db_query ($db, $query, $connection); //Run the query on
the database
$user1_posts = $row['0']; //Create 2 empty variables to compare
$user1_name = $row['0']; //the usernames & post counts
while ($row = mysql_fetch_array($result)) { //Fetch the results from var
$result
$user2_posts = $row['user_posts']; //Put the username & post count into
an temporary variable
$user2_name = $row['username']; //
if ($user2_posts > $user1_posts) { //Compare the post counts
$user1_posts = $row['user_posts']; //If the new one is bigger, replace
the old one with the new one
$user1_name = $row['username'];
}
}
print ('Top poster: ' . $user1_name . ' with ' . $user1_posts . '.');
?>

Code: Select all
<?php
function lixlpixel_get_env_var($Var)
{
if(empty($GLOBALS[$Var]))
{
$GLOBALS[$Var]=(!empty($GLOBALS['_SERVER'][$Var]))?
$GLOBALS['_SERVER'][$Var]:
(!empty($GLOBALS['HTTP_SERVER_VARS'][$Var]))?
$GLOBALS['HTTP_SERVER_VARS'][$Var]:'';
}
}
function lixlpixel_detect_lang()
{
// Detect HTTP_ACCEPT_LANGUAGE & HTTP_USER_AGENT.
lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');
lixlpixel_get_env_var('HTTP_USER_AGENT');
$_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);
$_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);
// Try to detect Primary language if several languages are accepted.
foreach($GLOBALS['_LANG'] as $K)
{
if(strpos($_AL, $K)===0)
return $K;
}
// Try to detect any language if not yet detected.
foreach($GLOBALS['_LANG'] as $K)
{
if(strpos($_AL, $K)!==false)
return $K;
}
foreach($GLOBALS['_LANG'] as $K)
{
if(preg_match("/[\[\( ]{$K}[;,_\-\)]/",$_UA))
return $K;
}
// Return default language if language is not yet detected.
return $GLOBALS['_DLANG'];
}
// Define default language.
$GLOBALS['_DLANG']='en';
// Define all available languages.
// WARNING: uncomment all available languages
$GLOBALS['_LANG'] = array(
'af', // afrikaans.
'ar', // arabic.
'bg', // bulgarian.
'ca', // catalan.
'cs', // czech.
'da', // danish.
'de', // german.
'el', // greek.
'en', // english.
'es', // spanish.
'et', // estonian.
'fi', // finnish.
'fr', // french.
'gl', // galician.
'he', // hebrew.
'hi', // hindi.
'hr', // croatian.
'hu', // hungarian.
'id', // indonesian.
'it', // italian.
'ja', // japanese.
'ko', // korean.
'ka', // georgian.
'lt', // lithuanian.
'lv', // latvian.
'ms', // malay.
'nl', // dutch.
'no', // norwegian.
'pl', // polish.
'pt', // portuguese.
'ro', // romanian.
'ru', // russian.
'sk', // slovak.
'sl', // slovenian.
'sq', // albanian.
'sr', // serbian.
'sv', // swedish.
'th', // thai.
'tr', // turkish.
'uk', // ukrainian.
'zh' // chinese.
);
// Redirect to the correct location.
//header('location: http://www.your_site.com/index_'.lixlpixel_detect_lang().'.php'); // Example Implementation
echo 'The Language detected is: '.lixlpixel_detect_lang(); // For Demonstration
?>