SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 2nd, 2003, 07:29 AM
rjpa rjpa is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Jutland
Posts: 6 rjpa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to rjpa
PageBreak and Spanning

Hi,

I'm running the site www.oldreviews.com which is a review site about old games and applications.

Now I've got a problem, if my reviews becomes very long I want to span them over several pages. All the contents are received from the database and resists in the $contents variable. How can I make this $contents span over several pages?

I want to do this by inserting a so called PageBreak just like in PHPNuke, I want to use the code <!--pagebreak--> for this?

Is there anyone that can help me with some code that does this?

Best regards

Rasmus

Reply With Quote
  #2  
Old June 7th, 2003, 03:48 AM
ApathyBoy ApathyBoy is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 3 ApathyBoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ApathyBoy
Got to love DevArticles

DevArticles has a great tutorial on this that might be able to help you out.

URL


Hope this helps!

Reply With Quote
  #3  
Old June 7th, 2003, 08:14 AM
rjpa rjpa is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Jutland
Posts: 6 rjpa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to rjpa
Re: Got to love DevArticles

Quote:
Originally posted by ApathyBoy
DevArticles has a great tutorial on this that might be able to help you out.

http://www.devarticles.com/art/1/310


Hope this helps!


Well I already got it working from some code elsewhere, but yes that article are indeed very good.

Here's the code that I used to do the stuff:

PHP Code:
 Så kører det:
<?
php
$db 
mysql_connect("localhost""root""") or die ("Sorry no connection to database server!");
mysql_select_db("test") or die ("Could not select the database!");
$sql mysql_query("SELECT * FROM contents");
$row mysql_fetch_array($sql);
$contents $row['contents'];

$breakpoint "<!--pagebreak-->";
$sidenummer = (isset($_GET['sidenummer'])) ? $_GET['sidenummer'] : 0;
echo 
$sidenummer;
    if(isset(
$contents) && isset($breakpoint))
    {
        
$pages explode($breakpoint$contents);
        
$numb_pages count($pages);
   
    if(
$pages)
    {
        if(
$sidenummer == 0)
        {
        echo 
$pages[$sidenummer] . "<center><a href='" $_SERVER['PHP_SELF'] . "?sidenummer=" intval($sidenummer 1) . "'>næste side</a>\n";
        }
        elseif(
$sidenummer == intval($numb_pages 1))
        {
        echo 
$pages[$sidenummer] . "<center><a href='" $_SERVER['PHP_SELF'] . "?sidenummer=" intval($sidenummer 1) . "'>forige side</a>\n";
        }
        else
        {
        echo 
$pages[$sidenummer] . "<center><a href=" $_SERVER['PHP_SELF'] . "?sidenummer=" intval($sidenummer 1) . ">forige side</a> - <a href=" $_SERVER['PHP_SELF'] . "?sidenummer=" intval($sidenummer 1) . ">næste side</a>";
    }
    }
  }
?> 

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > PageBreak and Spanning


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway