@ 2014-06-04T20:38:06Z <?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
session_start();
if (!isset($_SESSION['username'])) {
header("location:login.php?error=1");
}
elseif (!isset($_SESSION['id'])) {
header("location:login.php?error=1");
}
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
define("DB_HOST","mysql117.loopia.se");
define("DB_USER","normal@i103189");
define("DB_PASS","KungMicke87");
define("DB_NAME","indiehjaerta_com");
if (isset($_POST['add']))
{
if (isset($_POST['forumid']) && (!empty($_POST['forumid'])))
{
if (isset($_POST['threadid']) && (!empty($_POST['threadid'])))
{
// Connect to MySQLi
$sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli));
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$saveThread = TRUE;
$emptyText = FALSE;
$text = mysqli_real_escape_string($sqli, $_POST['text']);
$fid = mysqli_real_escape_string($sqli, $_POST['forumid']);
$tid = mysqli_real_escape_string($sqli, $_POST['threadid']);
$query = mysqli_query($sqli,"SELECT * FROM forumcat WHERE id='$fid'") or die("Error: ".mysqli_error($sqli));
$resultsCategory = mysqli_num_rows($query);
$query2 = mysqli_query($sqli,"SELECT * FROM forumtopics WHERE id='$tid'") or die("Error: ".mysqli_error($sqli));
$resultsThread = mysqli_num_rows($query2);
if ($resultsCategory == 0)
{
$error = "No such CategoryID.";
}
elseif ($resultsThread == 0)
{
$error = "No such resultsThreadID.";
}
else
{
$timestamp = date('Y-m-d H:i:s');
$userid = $_SESSION['id'];
$ip = ip2long($_SERVER['REMOTE_ADDR']);
if (empty($text))
{
$emptyText = TRUE;
$saveThread = FALSE;
}
if ($saveThread == TRUE)
{
$addquery = mysqli_query($sqli,"INSERT INTO forumreplies (`text`, `categoryid`, 'threadid`, `userid`, `timestamp`, `ipaddress`) VALUES ('$text', '$fid', '$tid', '$userid', '$timestamp', '$ip')");
$tid = mysqli_insert_id($addquery);
header("location:forummessage.php?added=thread&fid=$fid&tid=$tid");
}
}
}
}
else
{
// Connect to MySQLi
$sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli));
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$saveThread = TRUE;
$emptySubject = FALSE;
$emptyText = FALSE;
$subject = mysqli_real_escape_string($sqli, $_POST['subject']);
$text = mysqli_real_escape_string($sqli, $_POST['text']);
$fid = mysqli_real_escape_string($sqli, $_POST['forumid']);
$query = mysqli_query($sqli,"SELECT * FROM forumcat WHERE id='$fid'") or die("Error: ".mysqli_error($sqli));
$results = mysqli_num_rows($query);
if ($results == 0)
{
$error = "No such CategoryID.";
}
else
{
$timestamp = date('Y-m-d H:i:s');
$userid = $_SESSION['id'];
$ip = ip2long($_SERVER['REMOTE_ADDR']);
if (empty($subject))
{
$emptySubject = TRUE;
$saveThread = FALSE;
}
elseif (empty($text))
{
$emptyText = TRUE;
$saveThread = FALSE;
}
if ($saveThread == TRUE)
{
$addquery = mysqli_query($sqli,"INSERT INTO forumtopics (`threadname`, `text`, `categoryid`, `userid`, `timestamp`, `ipaddress`) VALUES ('$subject', '$text', '$fid', '$userid', '$timestamp', '$ip')");
$tid = mysqli_insert_id($addquery);
header("location:forummessage.php?added=thread&fid=$fid&tid=$tid");
}
}
}
}
else
{
echo "No ForumID set.";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>indiehjaerta.com - Forum</title>
<link href="style_test.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="login.php">Login<a/> -
<a href="admin.php">Admin<a/> -
<a href="members.php">Members<a/> -
<a href="register.php">Register<a/> -
<a href="blog.php">Blog<a/> -
<a href="news.php">News<a/> -
<a href="event.php">Event<a/> -
<a href="forum.php">Forum<a/> -
<a href="logout.php">Logout<a/>
<br />
<hr />
<br />
<?php
if (isset($_GET['added']) && ($_GET['added'] == 'thread'))
{
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<strong>Forums</strong>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Thread Created</strong></td>
</tr>
<tr>
<td colspan="3"><a href="forum.php?fid=<?php echo $_GET['fid'] ?>&tid=<?php echo $_GET['tid'] ?>" style="color: black">Link to thread.</a></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
elseif (isset($_GET['action']) && $_GET['action'] == 'new')
{
if (isset($_GET['type']) && $_GET['type'] == 'thread')
{
if (isset($_GET['fid']) && empty(!$_GET['fid']))
{
if (isset($_GET['tid']) && empty(!$_GET['tid']))
{
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<strong>Forums</strong>
</td>
</tr>
<tr>
<form method="post" action="">
<input name="forumid" type="hidden" id="forumid" value="<?php echo $_GET['fid'] ?>">
<input name="threadid" type="hidden" id="threadid" value="<?php echo $_GET['tid'] ?>">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Answer to Thread</strong></td>
</tr>
<tr>
<td colspan="3"><?php if(isset($error)) { echo $error; } ?></td>
</tr>
<tr>
<td width="78"><strong>Subject</strong></td>
<td width="6">:</td>
<td width="294"><input name="subject" type="text" id="subject" readonly></td>
</tr>
<tr>
<td>Story</td>
<td>:</td>
<td><textarea name="text" type="text" id="text" rows="3"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="add" value="Post"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?php
}
else
{
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td>
<strong>Forums</strong>
</td>
</tr>
<tr>
<form method="post" action="">
<input name="forumid" type="hidden" id="forumid" value="<?php echo $_GET['fid'] ?>">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Create Thread</strong></td>
</tr>
<tr>
<td colspan="3"><?php if(isset($error)) { echo $error; } ?></td>
</tr>
<tr>
<td width="78"><strong>Subject</strong></td>
<td width="6">:</td>
<td width="294"><input name="subject" type="text" id="subject"></td>
</tr>
<tr>
<td>Story</td>
<td>:</td>
<td><textarea name="text" type="text" id="text" rows="3"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="add" value="Post"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?php
}
}
else
{
echo "Forum ID missing.";
}
}
}
else
{
echo "Nothing to see here.";
}
?>
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<span class="text">Page generated in '.$total_time.' seconds.</span><br />';
?>
</body>
</html>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.29 0.009 0.040 12.53 5.4.28 0.013 0.041 12.43 5.4.27 0.007 0.046 12.42 5.4.26 0.011 0.057 12.43 5.4.25 0.012 0.059 12.43 5.4.24 0.008 0.037 12.42 5.4.23 0.008 0.049 12.41 5.4.22 0.008 0.043 12.42 5.4.21 0.007 0.047 12.41 5.4.20 0.011 0.062 12.41 5.4.19 0.016 0.067 12.41 5.4.18 0.010 0.066 12.41 5.4.17 0.014 0.043 12.42 5.4.16 0.008 0.047 12.41 5.4.15 0.007 0.048 12.41 5.4.14 0.009 0.055 12.10 5.4.13 0.015 0.066 12.08 5.4.12 0.007 0.037 12.05 5.4.11 0.003 0.040 12.05 5.4.10 0.006 0.038 12.05 5.4.9 0.011 0.035 12.04 5.4.8 0.007 0.040 12.05 5.4.7 0.008 0.041 12.04 5.4.6 0.009 0.040 12.04 5.4.5 0.014 0.050 12.04 5.4.4 0.007 0.038 12.03 5.4.3 0.004 0.042 12.02 5.4.2 0.011 0.059 12.02 5.4.1 0.006 0.045 12.03 5.4.0 0.008 0.045 11.52 5.3.28 0.013 0.046 12.71 5.3.27 0.008 0.051 12.73 5.3.26 0.010 0.054 12.72 5.3.25 0.008 0.037 12.72 5.3.24 0.011 0.036 12.72 5.3.23 0.007 0.062 12.71 5.3.22 0.012 0.035 12.68 5.3.21 0.013 0.071 12.68 5.3.20 0.011 0.060 12.68 5.3.19 0.009 0.051 12.68 5.3.18 0.011 0.052 12.68 5.3.17 0.008 0.061 12.67 5.3.16 0.011 0.073 12.67 5.3.15 0.006 0.060 12.68 5.3.14 0.018 0.067 12.66 5.3.13 0.008 0.041 12.65 5.3.12 0.010 0.038 12.66 5.3.11 0.010 0.041 12.66 5.3.10 0.017 0.083 12.13 5.3.9 0.013 0.051 12.11 5.3.8 0.006 0.048 12.11 5.3.7 0.009 0.044 12.10 5.3.6 0.013 0.034 12.09 5.3.5 0.007 0.037 12.03 5.3.4 0.009 0.036 12.03 5.3.3 0.011 0.048 12.00 5.3.2 0.015 0.054 11.77 5.3.1 0.008 0.036 11.74 5.3.0 0.007 0.045 11.73 5.2.17 0.004 0.038 9.24 5.2.16 0.008 0.045 9.23 5.2.15 0.004 0.052 9.24 5.2.14 0.010 0.072 9.23 5.2.13 0.006 0.033 9.19 5.2.12 0.008 0.030 9.19 5.2.11 0.009 0.028 9.20 5.2.10 0.007 0.032 9.20 5.2.9 0.006 0.032 9.20 5.2.8 0.004 0.039 9.20 5.2.7 0.005 0.035 9.20 5.2.6 0.006 0.033 9.14 5.2.5 0.005 0.035 9.11 5.2.4 0.003 0.038 9.09 5.2.3 0.007 0.031 9.07 5.2.2 0.004 0.032 9.07 5.2.1 0.007 0.028 9.00 5.2.0 0.005 0.033 8.86 5.1.6 0.004 0.027 8.14 5.1.5 0.005 0.033 8.14 5.1.4 0.004 0.030 8.12 5.1.3 0.007 0.027 8.48 5.1.2 0.005 0.029 8.50 5.1.1 0.007 0.025 8.22 5.1.0 0.004 0.028 8.22 5.0.5 0.006 0.020 6.72 5.0.4 0.005 0.020 6.57 5.0.3 0.001 0.036 6.38 5.0.2 0.007 0.018 6.36 5.0.1 0.002 0.032 6.33 5.0.0 0.002 0.045 6.33 4.4.9 0.012 0.025 4.78 4.4.8 0.006 0.025 4.76 4.4.7 0.004 0.025 4.76 4.4.6 0.006 0.014 4.75 4.4.5 0.002 0.023 4.77 4.4.4 0.002 0.034 4.71 4.4.3 0.004 0.020 4.76 4.4.2 0.003 0.020 4.84 4.4.1 0.003 0.021 4.85 4.4.0 0.004 0.030 4.76 4.3.11 0.002 0.026 4.67 4.3.10 0.005 0.022 4.66 4.3.9 0.005 0.021 4.63 4.3.8 0.004 0.031 4.61 4.3.7 0.004 0.020 4.63 4.3.6 0.012 0.019 4.63 4.3.5 0.002 0.025 4.63 4.3.4 0.009 0.033 4.56 4.3.3 0.007 0.016 3.37 4.3.2 0.014 0.029 3.34 4.3.1 0.005 0.021 3.30 4.3.0 0.003 0.020 7.15
preferences:dark mode live preview
150.68 ms | 1398 KiB | 7 Q