$my_time=time();
<?php
if ( ! isset( $_SESSION["username"] ) )
{
$user="unknown";
}
if ( isset( $_SESSION["username"] ) )
{
$user=$_SESSION["username"];
}
$my_time=time();
$tarikh=$the_date.$the_week.$hour;
//echo"<br>time= ".$my_time;
mysqli_set_charset($ccoonn, "utf8");
$sql = "INSERT INTO `posts` (`post`,`topic`,`user`,`post_date`,`post_time`) VALUES ( '$post','$topic_number','$user','$tarikh','$my_time')";
$result = mysqli_query($ccoonn ,$sql);
?>
require_once "./../../folder_name/jdf.php";
$hour= jdate('g:i A');
$the_week=jdate('l');
$the_date=jdate('Y/m/d ');
// $post $topic_number ------------99
include"create_post.php";//---------99
?>
<center>
<form id='myform' action="<?php echo $_SERVER['PHP_SELF']; ?>" method = 'POST'>
post: <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="number" value='.$post_number.'>';
?>
<center>
<input type="submit" name='act' form='myform' value="Submit" style=" font-size:40px; height:90px; width:150px"> </center>
</form>
</center>
echo $post;
$post_number=test_input($_GET["number"]);
if(isset($_POST['act']))
{// if action
$post_number=test_input($_POST["number"]);
$post_text=test_input($_POST["post_text"]);
mysqli_set_charset($ccoonn, "utf8");
$sql = "UPDATE posts SET post='$post_text' WHERE number=$post_number";
$result = mysqli_query($ccoonn ,$sql);
}// if action
if(isset($post_number))
{
mysqli_set_charset($ccoonn, "utf8");
$sql = "SELECT * FROM posts WHERE number=$post_number";
$result = mysqli_query($ccoonn ,$sql );
while($info = mysqli_fetch_array( $result ))
{
$post=$info['post'];
}//while
} // if post number was set
$post_number=test_input($_GET["number"]);
require "./../../ccoonn.php";
if ( $_SESSION["username"] == $user )
echo'<a href="edit_post.php?number='.$post_number.'">'.$str.'</a>';
if ( $_SESSION["username"] != $user )
die("sorry");
if ( $_SESSION["username"] == $user )
{// Auth
.....
....
.....
....
//count:
mysqli_set_charset($ccoonn, "utf8");
$sql = "SELECT * FROM topics WHERE number=$topic_number ";
$result = mysqli_query($ccoonn ,$sql);
while($info = mysqli_fetch_array( $result ))
{
$count=$info['count'];
}
$count=$count+1;
$sql = "UPDATE topics SET count='$count' WHERE number=$topic_number";
$result = mysqli_query($ccoonn ,$sql);
// need $topic_number
include"topic_parts/count.php";
echo"<table border=1>"; echo"<tr>";
echo"<td style=' width:85%; background-color: #dd7777;'>";
echo"<center><h4>".$the_date.$the_week.$hour."</h4></center>";
echo"</td>";
echo"<td style=' width:85%; background-color: #9999cc;'>";
echo"<center><h3>Hi</h3></center>";
echo"</td>";
echo"<td style=' width:85%; background-color:#88cc88;'>";
echo"<center><h3>Index</h3></center>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo"<td style=' width:85%; background-color: rgba(20,50,220,0.2);'>";
echo"<div id='category'>";
echo $name;
echo"</div'>";
echo"</td>";
#category
{
font-size:30px;
text-align:center;
width:85%;
border:7px solid #115555;
background-color: rgba(220,150,20,0.5);
border-radius: 10px;
padding-bottom:30px;
}
#category
{
font-size:30px;
text-align:center;
width:20%;
border:7px solid #115555;
background-color: rgba(220,150,20,0.5);
border-radius: 10px;
padding-bottom:30px;
}
#user
{
font-size:18px;
text-align:center;
width:90%;
background-color: rgba(180,120,100,1);
border-radius: 8px;
padding-left:20px;
padding-right:20px;
border:3px solid #995555;
}
#user
{
font-size:18px;
text-align:center;
width:90%;
background-color: rgba(180,120,100,1);
border-radius: 8px;
margin-left:20px;
margin-right:20px;
border:3px solid #995555;
}