Jump to content

Recommended Posts

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...

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.

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...  8)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.