Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    28
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Question PHP load content

    I'm pretty new with php, as far as coding myself. I'm familiar with how wordpress is laid out and how the php functions there, but obviously coding from scratch is very different.

    In wordpress, the main theme index.php file has things like...
    Code:
    <?php
    get_header();
    ?>
    And it imports content from another .php file.

    What I'm looking to do is click a certain link in a navigation bar, then the bar slides upward, and the content(the php page) fades in below it.

    The sliding and fading is javascript and jQuery. I'm looking for a way to both use something similar to wordpress' <?php get_header(); ?> to load new content without reloading the page, and to also integrate the php request into a javascript array (or something of the like) so a certain .php file loads depending what you press.

    http://www.mattboldt.com/audio/index.htm Here is what I want the effect to do. I realize this is an .htm file and has no php.

    http://www.mattboldt.com/audio/index.php Here's the php version... for some reason when I view the source my php code isn't visible... I'm not sure why. I'm checking my hosting provider now.


    Anyway, help on this particular php script would be nice. I think I can take care of the javascript myself.

    Thanks.
    Last edited by Matt Boldt; 07-31-2011 at 05:15 AM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You can't see PHP scripting when you view the source.
    The server processes the PHP before it serves the webpage to the user.

    You have to look at the "raw" PHP file (script), as it appears on the server.


    .

  • #3
    New Coder
    Join Date
    Jul 2009
    Posts
    28
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Yeah I realize that now. I must have forgotten the concept of "server-side" script.

    Any help with the php loading though?

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    It will have to involve a method called AXAJ,
    which is Javascripting along with PHP. I don't have
    the exact solution for you, but it would allow things
    to happen without a page refresh.

    You may have to hire a freelancer that can program this for you,
    or in the least, offer an example of how it would work.


    .

  • #5
    New Coder
    Join Date
    Jul 2009
    Posts
    28
    Thanks
    2
    Thanked 3 Times in 3 Posts
    So I'm guessing this script is not a simple one. How is it done through wordpress?

    I'll have to google around to find a similar script.


  •  

    Tags for this Thread

    Posting Permissions

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