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.

Please somebody answer my question

Discussion in 'PHP' started by jeancloud, Feb 28, 2012.

  1. #1
    :D
    hi my name is jean, i have a problem in PHP. I am fresher of it also. so please give me full answer
    i want to send the checkbox value into php database. i tried a lot but couldn't do please help me somebody and provide me htmlpage and php page and mysql too thanks in advance!:)
     
    jeancloud, Feb 28, 2012 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    29,117
    Likes Received:
    4,611
    Best Answers:
    124
    Trophy Points:
    665
    #2
    You need to go back to basics and write a basic php script with a form, the checkbox and a submit button. Make it a get form and when you test for $_GET echo out the values that are returned. Saving to the database is standard, no need to send you the mysql - and you'll do better if you learn it step by step.
     
    sarahk, Feb 28, 2012 IP
  3. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #3
    I think you failed because it maybe wrong type of datatype when you use SQL INSERT command.
    Try to convert data to 0-1 before execute SQL command like this:

    $checked = isset($_POST['checked']) ? "1" : "0";

    Good luck!
     
    kids, Mar 4, 2012 IP
  4. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #4
    check out the following functions in php

    php.net/isset
    php.net/print_r
    php.net/foreach
    php.net/$_POST
    php.net/$_SERVER (for the $_SERVER['REQUEST_METHOD'] check == "post")

    and ofcource you need to know how checkboxes work in html/forms.

    Good luck! :)
     
    EricBruggema, Mar 4, 2012 IP