$sql = "DELETE FROM posts WHERE number=$post_number";
mysqli_set_charset($conn, "utf8"); // yaftane topici ke bodim
$sql = "SELECT * FROM posts WHERE number=$post_number";
$result = mysqli_query($conn ,$sql );
while($info = mysqli_fetch_array( $result ))
{
$topic_number=$info['topic'];
}//while
$str="delete";
if ( $_SESSION["username"] == $user )
echo'<a href="delete_post.php?number='.$post_number.'">'.$str.'</a>';
if ( $_SESSION["username"] == $user ) //aya khode saheb posteh
{// Auth
if( ! isset($_POST['act']))
{
....
.....
.....
......
echo"<div id='forum'>";
echo"<div id='forum_inner'>";
echo"<a href='http://saalek110.is-great.net/forum/forum.php?number=$forum_number'>".$forum_name."</a>";
echo"<div id='forum_desc'>";
echo $forum_sharh;
echo"</div'>";
echo"</div'>";
echo"</div'>";
if ($user=="hamid")
{
echo"<div id='user_darajeh'>";
echo"Active";
echo"</div>";
}
echo"<div id='user_active'>";
if ($user=="hamid") echo"Active";
echo"</div>";
[code]
<pre><code>
</code></pre>
$post=str_replace("[code]","<div id='code-kadr'><pre><code>",$post);
$post=str_replace("
direction: ltr;
text-align: left;
background-color:rgba(250,190,150,0.6);
border:1px solid #eeff22;
border-radius:5px;
& (ampersand) &
" (double quote) ", unless ENT_NOQUOTES is set
' (single quote) ' (for ENT_HTML401) or ' (for ENT_XML1, ENT_XHTML or ENT_HTML5), but only when ENT_QUOTES is set
< (less than) <
> (greater than) >
<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new; // <a href='test'>Test</a>
?>
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
$post = htmlspecialchars($post);
$sql="update topics SET time=$my_time WHERE number=$the_topic_number";
$my_time=time();
UPDATE `posts` SET `leader_post`="no" WHERE 1
$leader_post=$info['leader_post'];
if($leader_post=="yes") echo"yes";
if ( $_SESSION["username"] == $user || $_SESSION["username"] == "Admin")
{// Auth
if( ! isset($_POST['act'])) // nemikham bade zadane dokmeye form baz form beyad
{
include"tools/my_buttons.php"; // dokme haye balaye editor
?>
<center>
<form id='myform' action="<?php echo $_SERVER['PHP_SELF']; ?>" method = 'POST'>
<?php
if($leader_post=="yes")
{
$sql2 = "SELECT * FROM topics WHERE number=$topic_number";
$result2 = mysqli_query($conn ,$sql2 );
while($info2 = mysqli_fetch_array( $result2 ))
{
$topic_title=$info2['title'];
}//while
echo'<textarea id="title_textarea" form="myform" name="topic_title" rows="2" cols="70">';
echo $topic_title;
echo'</textarea><br><br>';
} // if($leader_post=="yes")
?>
<textarea id="mytextarea" form="myform" name="post_text" rows="10" cols="70">
<?php echo $post; ?>
</textarea><br><br>
<?php
echo'<input type="hidden" id="custId" name="post_number" value='.$post_number.'>';
echo'<input type="hidden" id="custId" name="topic_number" value='.$topic_number.'>';
echo'<input type="hidden" id="custId" name="leader_post" value='.$leader_post.'>';
?>
<center>
<input type="submit" name='act' form='myform' value="Submit" style=" font-size:40px; height:90px; width:150px"> </center>
</form>
</center>
<?php
} // if not action then show form
}//Auth
if ( $_SESSION["username"] == $user || $_SESSION["username"] == "Admin" ) //aya khode saheb posteh
{// Auth
if(isset($_POST['act']))
{// if action
$leader_post=test_input($_POST["leader_post"]);
if ( $leader_post=="yes")
{
$post_number=test_input($_POST["post_number"]);
$topic_number=test_input($_POST["topic_number"]);
$post_text=test_input($_POST["post_text"]);
$topic_title=test_input($_POST["topic_title"]);
mysqli_set_charset($conn, "utf8");
$sql = "UPDATE posts SET post='$post_text' WHERE number=$post_number";
$result = mysqli_query($conn ,$sql);
$sql = "UPDATE topics SET title=' $topic_title' WHERE number=$topic_number";
$result = mysqli_query($conn ,$sql);
} // leader_post=yes
if ( $leader_post=="no")
{
$post_number=test_input($_POST["post_number"]);
$topic_number=test_input($_POST["topic_number"]);
$post_text=test_input($_POST["post_text"]);
mysqli_set_charset($conn, "utf8");
$sql = "UPDATE posts SET post='$post_text' WHERE number=$post_number";
$result = mysqli_query($conn ,$sql);
} // leader_post=yes
echo"<div id='msg'>";
echo"<a href='http://saalek110.is-great.net/forum/topic.php?number=$topic_number'>"."return to topic"."</a>";
echo"<br>";
$the_word=writeMsg(18) ;
echo $the_word;
echo"</div>";
}// if action
} // auth
$_SESSION["username"] == "Admin"
UPDATE `topics` SET `top`="no" WHERE 1
$sql = "SELECT * FROM topics WHERE forum=$forum_number AND top='yes' ORDER BY topic_time DESC";
mysqli_set_charset($conn, "utf8");
$sql = "SELECT * FROM topics WHERE forum=$forum_number AND top='yes' ORDER BY topic_time DESC";
$result = mysqli_query($conn ,$sql);
include"forum_parts/show_topics.php";
$sql = "SELECT * FROM topics WHERE forum=$forum_number AND top='no' ORDER BY topic_time DESC";
$result = mysqli_query($conn ,$sql);
include"forum_parts/show_topics.php";
<?php
echo"<center>";
echo"<table style=' width:100%; background-color: #9999cc;'>";
while($info = mysqli_fetch_array( $result ))
{
echo"<tr>";
$topic_title=$info['title'];
$topic_number=$info['number'];
$topic_count=$info['count'];
$topic_time=$info['topic-time'];
$topic_top=$info['top'];
echo"<td style=' width:100%; background-color: #9999cc;'>";
echo"<div id='forum'>";
//echo $name;
echo"<a href='http://saalek110.is-great.net/forum/topic.php?number=$topic_number'>".$topic_title."</a>";
if ( $topic_top=="yes") echo"top";
echo"<div id='count'>"; // div inside div
echo $topic_count;
echo"</div>";
echo"</div>";
echo"</td>";
echo"</tr>";
}
echo"</table>";
echo"</center>";
?>