PHP Crew v.ihaventaskedaquestioninawhile

Discussion in 'OT Technology' started by k2737, Jan 17, 2006.

  1. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    Is it a bad idea to base what outputs on logic? Like they click a button and by using logic and if statments I set what should be outputed? I guess the other way to do this would be to just create another page. Are there any downfalls to this? Other then code being long and probably confusing unless it is well comented? :o
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,925
    Likes Received:
    11
    Location:
    Los Angeles
    I did that on a recent script because I was lazy. I just passed the changing data via a $_GET variable. :o

    It's not very clean. I usually keep my work object oriented but if it needs to be done I don't see a problem doing it.
     
  3. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    In the future I will probably change it all to make it 'proper' but right now how I am doing it makes sense to me so I am running with it.
     
  4. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    There is no problem with it at all, in terms of making it work. The only downfall, is like you mentioned, lots of code. If you're going to have multiple if statements here and there just to handle the output, maintaining it will be time-consuming. I, personally, use the different page methods. That way, if I have to change something in the 'false' statement, I know to just look at the page set for 'false'.

    I don't think it will also take up more server resources, as it will only run part of the code and not all. But yes, do what makes sense to you for now. Once you get the hang of it, make it efficient. Usually, it's "make it work, then make it efficient".
     
  5. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    i do that depending on how lazy i am, and how fast i need to get it done.

    usually i stick to strick OOP with lots of design & analysis done before hand so i don't have to worry about problems like that.
     
  6. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    It is also easier for me to lock one page with sessions....when I get into multiple pages it never seems to work right. I think I need to read up on sessions a little bit more. :o
     

Share This Page