Problem paginating in muti tabbed page. Pagination shows in other tabs. Need help as I am a self taught php programmer.

#1
[eluser]Venu12[/eluser]
Code:
<?php

require_once('./includes/base.php');


if($_GET['logout'] == 1){
    @$_SESSION = array();
    @session_unregister($_SESSION['userID']);
    @session_unregister($_SESSION['userName']);
    @session_unregister($_SESSION['userUser']);
    @session_unregister($_SESSION['userPass']);
    @session_destroy();
}

require("./templates/$template/header.php");

?>

<div id="blurb"  align="right">

[removed]
    function isClear()
        {
            document.myForm[0].value='';
            return true;
        
        }
    [removed]
    
    &lt;?php
ob_start();
if(!empty($_SESSION['userID']) and !empty($_POST['user'])){
echo '&lt;form action="search.php" method="post" name="myForm"&gt;
&lt;input type="text" value="search here" id="search" size="20" name="search"&gt;
&lt;input type="submit" name="serachuser" value="search"/&gt;&lt;/form>';
}
?&gt;
</div>
<br>
<div id="blurb" align="justify">
<em>Hello world?</em> &lt;?php echo "$sitename"; ?&gt; is blah blah blah.....!
</div>
<br>

<div id="container-5">
            <ul>
                <li><a href="#fragment-13"><span>Blog</span></a></li>
                <li><a href="#fragment-14"><span>Links</span></a></li>
                <li><a href="#fragment-15"><span>Images</span></a></li>

            </ul>
            <div id="fragment-13">
                &lt;?php
    
                
$sql = mysql_query("SELECT users.userUser, posts.postID, posts.postPost, posts.postTime, posts.postComments, userAvatar  FROM users, posts WHERE users.userID = posts.postUserID ORDER BY posts.postTime DESC ");                
while($row = mysql_fetch_array($sql)){
    $abcd= $row['userName'];
    $abcd = str_replace (" ", "-", $abcd);
$time = reltime($row['postTime']);

    echo '
    <div class="virtualpage">
    
<table width="100%" >
      <td width="10%" ><a href="'.$site_url.'/'.$row['userUser'].'"><img src="'.$site_url.'/avatars/'.$row['userAvatar'].'"  width="48px" height="48px" /><td width="90% "bgcolor="#F8F8F8"  border=1" cellspacing="1" cellpadding="1" ><b>'.$row['postPost'].'</b><br>Posted by:&nbsp;'.$row['userUser'].',&nbsp;<a href="'.$site_url.'/blogs/'.$row['userUser'].'/'.$row['postID'].'">Comments</a>&nbsp;'.$row['postComments'].' ,&nbsp;Time elapsed:&nbsp; '.$time.'</a></td>
    </table><br>
    
    </div>';}
    ?&gt;

&lt;?
echo '<div id="gallerypaginate" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>' ;

                ?&gt;  
<div style="clear:both"></div>

            </div>


            <div id="fragment-14">
                &lt;?php
     $sql = mysql_query("SELECT users.userUser, links.linksID, links.linksLink, links.linksPost, links.linksTime, links.linksComments,userAvatar FROM users, links WHERE users.userID = links.linksUserID ORDER BY links.linksTime DESC");
while($row = mysql_fetch_array($sql)){
    $abcd= $row['userName'];
    $abcd = str_replace (" ", "-", $abcd);
$time1 = reltime($row['linksTime']);

    echo '
    <div class="virtualpage">
    
<table width="100%" >
      <td width="10%" ><a href="'.$site_url.'/'.$row['userUser'].'"><img src="'.$site_url.'/avatars/'.$row['userAvatar'].'"  width="48px" height="48px" /><td width="90% "bgcolor="#F8F8F8"  border=1" cellspacing="1" cellpadding="1" ><b>'.$row['linksPost'].'</b><br>Posted by:&nbsp;'.$row['userUser'].',&nbsp;<a href="'.$site_url.'/blogs/'.$row['userUser'].'/'.$row['linksID'].'">Comments</a>&nbsp;'.$row['linksComments'].' ,&nbsp;Time elapsed:&nbsp; '.$time1.'</a></td>
    </table><br>
    
    </div>';}

    ?&gt;



&lt;?
echo '<div id="gallerypaginate" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>' ;

                ?&gt;  

            </div>
            <div id="fragment-15">
                &lt;?php
                // testing
                grabimages('SELECT users.userUser, images.imagesID, images.imagesFile, images.imagesPost, images.imagesTime, images.imagesComments FROM users, images WHERE users.userID = images.imagesUserID ORDER BY images.imagesTime DESC LIMIT 20');

                ?&gt;

            </div>
        </div>





&lt;?php


require("./templates/$template/footer.php");
?&gt;

<table align="center"><tr><td align="center">
[removed]
var gallery=new virtualpaginate("virtualpage",10)
gallery.buildpagination("gallerypaginate")
[removed]
</td></tr></table>

            </div>

#2
[eluser]n0xie[/eluser]
Could you please explain again what part of this is related to CodeIgniter?

#3
[eluser]Venu12[/eluser]
Code and application development.

#4
[eluser]Venu12[/eluser]
I fixed the problem all by myself. My site www.allmicrochat.com is now up running with virtual pagination in each and every tab!

Thanks anyway. Learned something new as a self taught prgrammer.

#5
[eluser]n0xie[/eluser]
[quote author="Venu12" date="1254418450"]I fixed the problem all by myself. My site www.allmicrochat.com is now up running with virtual pagination in each and every tab!

Thanks anyway. Learned something new as a self taught prgrammer.[/quote]
I'm also a self taught programmer, and as one I can tell you you're mixing your business logic, datamodel and representation layer. If I were you I would take a look at CodeIgniter (which coincidently is what this forum is all about) and the way it is organized (following the model-view-control design pattern).

Maybe you can learn some more!

#6
[eluser]renownedmedia[/eluser]
"Self taught programmer"

Can I get a quick raise of hands from anyone who is NOT a self taught php programmer here?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.