ajloun
01-24-2010, 12:00 AM
Hello
what i try to do is , limit the User from Editing his Post in one Minute after that he can Not edit his post. after 60s
this wht i did and did not work .
1- get the time of the Post from the Mysql
$sql=mysql_query("SELECT * FROM test WHERE id='$id'")
or die("can't get the sql");
$row = mysql_fetch_array($sql);
2- Now See if the time in the Mysql Plus 60s is Passed ..
$time_now=time(); // time now notice that the time in thd database is stored in the same way
//after extracting data from the database
$database_time=$row['datetime']+60; //the time in the database + 60 seconds
if($time_now>$database_time){
echo "You are not allowed to edit ur post now";
}else{
echo "edit";
}
that did not work .. So whts wrong ..
what i try to do is , limit the User from Editing his Post in one Minute after that he can Not edit his post. after 60s
this wht i did and did not work .
1- get the time of the Post from the Mysql
$sql=mysql_query("SELECT * FROM test WHERE id='$id'")
or die("can't get the sql");
$row = mysql_fetch_array($sql);
2- Now See if the time in the Mysql Plus 60s is Passed ..
$time_now=time(); // time now notice that the time in thd database is stored in the same way
//after extracting data from the database
$database_time=$row['datetime']+60; //the time in the database + 60 seconds
if($time_now>$database_time){
echo "You are not allowed to edit ur post now";
}else{
echo "edit";
}
that did not work .. So whts wrong ..