View Full Version : PHP load content

Matt Boldt
07-31-2011, 05:09 AM
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...


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.


07-31-2011, 09:01 PM
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.


Matt Boldt
07-31-2011, 09:38 PM
Yeah I realize that now. I must have forgotten the concept of "server-side" script.

Any help with the php loading though?

08-01-2011, 02:48 AM
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.


Matt Boldt
08-03-2011, 03:03 AM
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.