Log in

View Full Version : Loading .php into <div>



polyGone
09-03-2006, 06:47 PM
I was using a script which I had gotten from this site. It uses "ajaxpage" to load pages into a <Div> tag. I have no problem loading the css with the loadobjects function or loading html into the divs. thats fine. It won't load a .php into the div though. any info? Can div's not hold .php.
If I just type in the address of the php it comes up as a page. So it definitly works.

AbelaJohnB
09-06-2006, 12:28 AM
Hello,

I have used this for my site www.ChristianBlog.com (http://www.christianblog.com/) and it's work rather well.


Here is what I am using for your review:



<link rel="stylesheet" type="text/css" href="ajaxtabs.css" />
<script type="text/javascript" src="ajaxtabs.js"></script>
<ul id="maintab" class="shadetabs">
<li <?php if($tabme == '') { echo 'class="selected"';};?>><a href="#default" rel="ajaxcontentarea">Profile</a></li>
<li <?php if($tabme == 'friends') { echo 'class="selected"';};?>><a href="bio_myfriends.php?uid=<?=$uid;?>" rel="ajaxcontentarea">Friends</a></li>
<li <?php if($tabme == 'blogs') { echo 'class="selected"';};?>><a href="bio_myblogarchive.php?uid=<?=$uid;?>" rel="ajaxcontentarea">Blogs</a></li>
<li <?php if($tabme == 'surveys') { echo 'class="selected"';};?>><a href="bio_mysurveys.php?uid=<?=$uid;?>" rel="ajaxcontentarea">Surveys</a></li>
<li <?php if($tabme == 'gallery') { echo 'class="selected"';};?>><a href="bio_mygallery.php?uid=<?=$uid;?>" rel="ajaxcontentarea">Gallery</a></li>
<li <?php if($tabme == 'shoutouts') { echo 'class="selected"';};?>><a href="bio_myshoutouts.php?uid=<?=$uid;?>" rel="ajaxcontentarea">Shout-outs</a></li>
</ul>
<div id="ajaxcontentarea" class="contentstyle">
some default text should go here... whever you want the "profile" tab listed first to display
</div>
<script type="text/javascript">
startajaxtabs("maintab")
</script>


You can see this in-action at: http://www.christianblog.com/bio/abelajohnb/

note my use to be able to pre-select a specific tab, via:



<li <?php if($tabme == 'shoutouts') { echo 'class="selected"';};?>>


That allows you to link to a specific tab, such as:

http://www.christianblog.com/bio/abelajohnb/gallery/

(I am using SEO url's, so your uri's might be slighly different)

Hope this helps!

AbelaJohnB
09-14-2006, 05:26 PM
So did this help you at all?