Re: Problem with code

From: Date: Mon, 06 Dec 2004 05:15:58 +0000
Subject: Re: Problem with code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203659@lists.php.net to get a copy of this message
On Dec 5, 2004, at 9:05 PM, Richard Kurth wrote:
I am having a problem with the code below it provides the first page with out any problem but when I select the next page it shows all the results from the first page and the results from the second page. It does the same thing on the third page also. I have been looking at it for two days and can not fined the error in the code <?php include("include/common.php"); include("$config[template_path]/user_top.html");
I don't see where you set $page. And I'm betting that you don't. Variables are not persistent from one page-load to the next. try adding this line in here: $page = $_GET['page'];
// If current page number, use it // if not, set one! if(!isset($page)){
    $page = 1;
} else {
    $page = $page;
}


« previous php.general (#203659) next »