Hello. I need some help with a code problem. I have this code bellow where in my database i have a table called collumn called "hiden" in a table called "ext" as you can se from the code bellow if hiden is set to 1 it prints out the message "hiden" and so on. Now, what i would like to do is to make this clickable to change it. so if hiden is set to 1 and i click "hiden" it should become "not hiden" insteed, and vice e versa. I hope someone could help me to achive this. if($row['hiden']==1){ $data[safe]="<font color='#ff0000'>hiden</font>"; }else{ $data[safe]="<font color='#0000ff'>not hiden</font>"; Code (markup):
Make the phrase a span with an ID. write a javascript/DOM function that changes the font color and text properties of the span based on their current state. Invoke the function using the onClick event of the span. EDIT: just to clarify you can't do what you seem to want with php, you have to do it at the client.