1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php / sql help

Discussion in 'Programming' started by izlik, Jan 12, 2010.

  1. #1
    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):

     
    izlik, Jan 12, 2010 IP
  2. dollarfish

    dollarfish Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #2
    Maybe you should provide more details
     
    dollarfish, Jan 12, 2010 IP
  3. izlik

    izlik Well-Known Member

    Messages:
    2,399
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    185
    #3
    what details do you need ?
     
    izlik, Jan 12, 2010 IP
  4. goliath

    goliath Active Member

    Messages:
    308
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #4
    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.
     
    goliath, Jan 13, 2010 IP