SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it possible to create javacsript like tabs with php?

    Hi all

    I've got to the point we're I need to create some type of tabbing on one of my pages and was wondering is it possible to create this with php? Instead of javascripts jQuery?

    Feedback or any links/examples would be great. Thanks

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP is not an alternative to JavaScript... It's a completely different thing. JavaScript would allow the user to change tabs without refreshing the page.

    You could do this in PHP, possibly by passing parameters through the query string:

    e.g. ?tab=2

    I'm not totally sure what you mean though...
    PHP is a server-side technology <-> JavaScript is Client-side.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Cape Cod
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it with PHP and css pretty easily but you will need the whole page to reload. If you use JS only the content of the tab will be reloaded.

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes thanks guys! I see... I forgot about the reload issue but I suppose I could add a simple anchor tag to position back.

    I'm not totally sure what you mean though...
    PHP is a server-side technology <-> JavaScript is Client-side.
    Yes I've been looking at the javascript examples but can't seem to get my head around them, just feel a lot more comfortable using php, I understand the server-side / Client-side issue..

    but I think "JavaScript would allow the user to change tabs without refreshing the page." would be better.. just seen your name Jimmy - jQuery WIZARD!

    You can do it with PHP and css pretty easily but you will need the whole page to reload. If you use JS only the content of the tab will be reloaded.
    Thanks I'll try the php way I think (or have you got any simple examples Jimmy / links for the jquery tabbing?), So what would a basic syntax look like for php tabbing?

    thanks guys

  5. #5
    hi galen's Avatar
    Join Date
    Jan 2006
    Location
    New Haven, CT
    Posts
    1,228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you don't make tabs with php. you make tabs with html that you output with php.

  6. #6
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you already have a jQuery setup, install the Web Developer toolbar for Firefox. Then go to your page with the jQuery generated tabs, and from WDT go to View Source > View Generated Source. This will show the DOM structure that jQuery has created (as HTML) and you can just replicate that output with PHP.

    As mentioned you'll need links in the tabs to trigger a page reload to show the different content.


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
  •