SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: long pages

  1. #1
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    long pages

    Hello,

    I'm writing an admin panel for a link directory. I wonder if it's a problem to maken an admin script of 2000 lines, instead of making 5 different pages, I know use 'switch($action){ case '1': blablabla break; etc...

    Do I lose speed when I use such long pages?

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Location
    London
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bram,

    I believe it does not make much difference since the compiler will skip the loops if a condition is not true.
    -- | StEaLThEn |--

  3. #3
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was just wondering about that I have an admin panel in one page of 3000 lines... Tought I would lose speed.

    thanks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nobb but do you reely want to work that way, do you reely want to scroll over 3000 lines of code when you are working.

    I use Include and Switch

    I have one page index.php

    In that page i have my switch query

    PHP Code:
    switch ($page)
    {
    case 
    news: include("news.inc"); break;
    case 
    forum include("forum.inc"); break;
    case 
    members: include("members.inc"); break;

    default: include(
    "newest_news.inc");

    so i just have to have to link index.php?page=forum to get the forum and so on and on.. if i have index.php and none in the "url query" the "default" that┤s on the bottom on the switch statement is started.

    I think i would just stick to this arcitecture for so on, and you should break the code into pages so you just have to open a page where it┤s only the code you are working on as forum.inc

    instead of using just one page with an huge switch statement of over 3000 lines where you are ages to find the part you want to work with like the code that is used in the forum.

    No i weren┤t asking fo exacly this, you were asking if the page was long to load if there is lot of code that is not used, but i think you are just making your work diffrent by having the code all in the same place

  5. #5
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea, i'd just put the contents of each switch in it's own file and just include it based on each case.
    would really save having to edit the file.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  6. #6
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally, I don't worry about the fact I have over 3000 lines, I use 'huge' comments'

    example:

    PHP Code:
    <?
    //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    //     USER CP
    //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    ?>

  7. #7
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's still really inefficient.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  8. #8
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, but I use that script to release for free. So, how less files how easier for the (in most cases) newbie php'er.

    For my guestbook script for example: 3 files
    an admin panel
    an index.php (guestbook: show entries + add entrie)
    a config.php
    That book includes flood control, smileys, bbcode, block ip's, edit/delete entries, templates management,...

  9. #9
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Defender1
    it's still really inefficient.
    and you're flushing bandwidth down the toilet
    I swear to drunk I'm not God.
    Matt's debating is not a crime ź
    Hint: Don't buy a stupid dwarf ÷ Clicky

  10. #10
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by weirdbeardmt
    and you're flushing bandwidth down the toilet
    with what, big comments? no, bandwidth wise, it doesn't matter how much PHP there is. it depends how much HTML it sends out -- that's what uses bandwidth.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  11. #11
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by DR_LaRRY_PEpPeR
    depends how much HTML it sends out -- that's what uses bandwidth.
    A table and a form, that's it

  12. #12
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by weirdbeardmt


    and you're flushing bandwidth down the toilet
    No your not, becuase php only sends out the stuff in like echo commands, so there is no difference in bandwith

  13. #13
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i read the above comment as being about html comments not php comments hence overuse of bandwidth.
    I swear to drunk I'm not God.
    Matt's debating is not a crime ź
    Hint: Don't buy a stupid dwarf ÷ Clicky

  14. #14
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by weirdbeardmt
    i read the above comment as being about html comments not php comments hence overuse of bandwidth.
    I don't use html commments, like I said, I use php comments, the client doesn't have to 'read' those comments...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •