sitinuraini Posted March 23, 2011 Share Posted March 23, 2011 localhost : Server version: 5.0.51b-community-nt phpMyAdmin - 2.11.7 -------------------------------------------------------------- hello guys, i have to continue my work more complex.. but i dont have any idea to do that... i want to restrict user from "edit" existing data, after a set of date... an example, a user input a value in "marks" in 1st January, and they can change it back if they want... BUT on 1st April 12AM, the user cannot "edit" the value of marks. for the input type of marks, i have use a textbox.. so that on 1st April 12AM, the textbox will automatically disable (cannot edit it, but still can see, basically in a grey color)... i still not do any coding for this coz i really dont have any idea.. how to start and where.... can anyone tutor me? i'm beginner in programming... Quote Link to comment https://forums.phpfreaks.com/topic/231457-want-to-restrict-editing-after-a-set-of-date/ Share on other sites More sharing options...
fenway Posted March 30, 2011 Share Posted March 30, 2011 That's all PHP-side, not in the DB. Quote Link to comment https://forums.phpfreaks.com/topic/231457-want-to-restrict-editing-after-a-set-of-date/#findComment-1193968 Share on other sites More sharing options...
sitinuraini Posted March 30, 2011 Author Share Posted March 30, 2011 someone told me use the TRIGGER.. i have see tutorial for TRIGGER.. erm... still use DB right? ok i will learn how php can do this... Quote Link to comment https://forums.phpfreaks.com/topic/231457-want-to-restrict-editing-after-a-set-of-date/#findComment-1193981 Share on other sites More sharing options...
ngreenwood6 Posted March 30, 2011 Share Posted March 30, 2011 you will probably need to do something like this: if(time() >= mktime(0,0,0,4,1,date('Y'))){ echo '<textarea disabled="disabled"></textarea>'; } else { echo '<textarea></textarea>'; } I dont know exactly what you are trying to do but you could compare the current time with the date that you want it not to be editable after (pretty much what I just showed you). This snippet of code will pretty much disable the textarea if the date is after april 1st of the current year. If thats not right then we will need to see some code and have a little more detail on what you are trying to accomplish. Quote Link to comment https://forums.phpfreaks.com/topic/231457-want-to-restrict-editing-after-a-set-of-date/#findComment-1194017 Share on other sites More sharing options...
sitinuraini Posted March 30, 2011 Author Share Posted March 30, 2011 thanks ngreenwood6 for teach me how.. first, i will try ur suggestion, and i'll tell if i have problem. just now i need to do another code problem. anyone who have idea can post something to help me here... i'll come to see here back.. (sorry broken english) ngreenwood6 : nice tagline... Quote Link to comment https://forums.phpfreaks.com/topic/231457-want-to-restrict-editing-after-a-set-of-date/#findComment-1194023 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.