#1
  1. No Profile Picture
    Devshed Gringo
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Toronto, Ontario
    Posts
    448
    Rep Power
    61

    Talking crap how stupid of me (checkboxes) not a ? [rant]


    Hi everyone! This is pretty funny or sad LOL

    For checkboxes in forms I used variable variables to process the info! Like: checkbox name = steve, value = yes

    Then I compare the checkbox name to the names in my database. HAHAHA that's pretty dumb of me.

    Code:
    while ($row = mysql_fetch_array($result)) {
              $name = $row['name'];
    if (isset($$name) && $$name = 'yes') {
           array_push($array, '$name');
    //etc...
    All I need to do is name my checkboxes so it will form an array and very much easy to process later on LOL Oh well live and learn I guess! I notice many dumb things I did but at least I notice them and change them. I wonder if other people did stupid errors like this when they started out?

    Just because it works doesn't mean it's okay to live with!

    On a side note do you think a PHP bloopers web site would be cool? I mean chunks of poorly written code along side with the proper way of doing things with a small explaination.. Could help people like me, when reading such a site and realize that some of my techniques are wrong. Only to change them into proper style and function? You could search the site by functions etc... I'd build such a thing but I could only supply the wrong techniques LOL...
    Still don't know how to do a "Hello World"?
  2. #2
  3. phpkid ~~~~~~ :o)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Nov 2000
    Location
    NJ, USA
    Posts
    2,534
    Rep Power
    16
    I can help you in one matter.

    I can provide you the correct code, cause it would be now hard for me to write blooper !!! not boasting about myself..but still....


    JD
    _____________________________
    d.k.jariwala (JD)
    ~ simple thought, simple act ~
    I blog @ http://jdk.phpkid.org
  4. #3
  5. No Profile Picture
    Devshed Gringo
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    Toronto, Ontario
    Posts
    448
    Rep Power
    61
    Yeah, it may be a fun little site but I will only have time until March, until then I'm booked

    In the mean time I'm reading alot of examples from the good coders such as you, jdk and others from these boards and taking apart cool scripts like phpmyadmin, etc...

IMN logo majestic logo threadwatch logo seochat tools logo