SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I do this in PHP without frames?

    I have a page that has hyperlinks on the left-hand side of the page and in the main part of the page I want the content to change based on which link is clicked. I want this to occur without being forwarded to a new page and I want this to occur without the use of frames. I have the content stored in another file as a function, so when the user clicks on the links it will call the function and then display in the middle of the same page from which the user clicks. I image I need to have the hyperlink read, <a href="<?php function() ?>">The Link</a> I'm just not sure how to get that to go into the middle of the page. I'm using a div tag <div class="middle_of_page"> and a style sheet to position it. Just not sure how to place it there. Has anyone else done something like this? If so, how?

    Thanks

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    3 ways to do this without refreshing the page:
    1) Frames, which you've said you don't want
    2) Iframes, which you don't want (just trust me)
    3) AJAX

    Either Google for AJAX tutorials or head over to the JavaScript forum to learn about it. You'd probably also be interested in some AJAX libraries - Sarissa and Prototype are both excellent.
    PHP questions? RTFM
    MySQL questions? RTFM

  3. #3
    SitePoint Addict
    Join Date
    Jul 2007
    Location
    San Jose, California
    Posts
    355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't quite read your whole thing through as I am extremely tired. But you may be able to hide layers. So you load everything onto a page, and then you show or a layer using javascript, each layer contains the information for the different pages.


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
  •