abeer Posted June 21, 2011 Share Posted June 21, 2011 Hi.. here is the url where i need pagination http://www.rintlbd.com/index.php?id=1 and this is the editor url ( ck editor) http://www.rintlbd.com/ck.php By the editor i put some paragraphs on it. and end of the paragraph i write {newpage] then started a new paragraph. pagination navigations comes.but when i click the page 2. the same apperas assame as page 1. and the page 1 and the page not splited up to two page and the {newpage} apeera in the article here is the full code <?php mysql_connect('mysql10', 'dlegu', 'dlegu') or die('Connection Failed'); mysql_select_db('legu') or die('Database not found'); $iDefaultRecord = 1; $id = isset($_GET['id']) ? filter_var($_GET['id'], FILTER_VALIDATE_INT) : $iDefaultRecord; $result = mysql_query("SELECT title, dtl, meta_d, meta_k FROM page WHERE id=$id"); if (!mysql_num_rows($result)) { header('Location: 404.php', true, 404); die();}$row = mysql_fetch_array($result);$title = stripslashes($row['title']);$dtl = stripslashes($row['dtl']);$meta_d = stripslashes($row['meta_d']);$meta_k = stripslashes($row['meta_k']); $pages = explode("{newpage}", $dtl); if(isset($_GET['page']) && $_GET['page'] > 0) { $current_page = $_GET['page']; if($current_page > count($pages)) { $current_page = count($pages); } } else { $current_page = 1; } $description = $pages[$current_page - 1]; $navigation = "Pages: "; for ($i = 1; $i <= count($pages); $i++) { if($i == $current_page) { $navigation .= "<b>"; } $navigation .= "<a href='?page=" . $i . "'> " . $i . "</a> "; if($i == $current_page) { $navigation .= "</b>"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="<?php echo $meta_k; ?>" /> <meta name="description" content="<?php echo $meta_d; ?>" /> <title><?php echo $title; ?></title> <link rel="stylesheet" href="cssReset.css" /> <link rel="stylesheet" href="style.css" /> <style type="text/css"> img, div, a, li, span{behavior:url(iepngfix.htc);} </style> </head> <body> <div id="top"> <div id="banner"> <h1><a href="#">Environmental.com</a> <span>site slogan here</span></h1> </div> <p id="help">Help Line 24 /7 Support 1800 3246 345</p> <div id="nav"> <ul> <li><a href="index.php?id=1" class="pageitem">index</a></li> <li><a href="index.php?id=2" class="pageitem">apple</a></li> <li><a href="?id=3" class="pageitem">banana</a></li> <li><a href="index.php?id=4" class="pageitem active">orange</a></li> <li><a href="index.php?id=5" class="pageitem">lemon</a></li> <li><a href="index.php?id=6" class="pageitem">nut</a></li> </ul> <div style="clear:both"></div> </div><!--end of navigation--> <div id="glow"> </div> <div style="clear:both"></div> </div><!-- end of top--> <div style="clear:both"></div> <div id="content"> <div id="left"> <div id="box1"> <img src="Images/hand.png" alt="Hand" /> <h3>below content will come from database</h3> <?php echo $dtl; ?> </div><!-- end of box1--> <div style="clear:both"></div> <!-- end of box2--> <div style="clear:both"></div> <!-- end of box3--> <div style="clear:both"></div> <div id="read"> </div> </div><!-- end of left div--> <div id="right"> </div> </div><!-- end of right div--> <div style="clear:both"></div> </div><!-- end of content--> <div style="clear:both"></div> <div id="footer"> </div><!-- end of footer--> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/239981-long-article-pagination-code-is-not-working-sucessfully/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.