B
brianj7675
Basically i'm trying to write a previous next link in order to go to
the next page in my database(similar to google's with numbers in the
middle for pages the user wants to jump to.
My only thought is i'm losing the parameters on page reload.
But if that is the case then I don't know the correct technique to keep
the variables
I am programming in php but using a javscript function with onclick.
I could use $_SESSION variables to retain the values in the page but i
shouldn't have to do that should I?
Here is the code:
for ($i=0; $i <= $max_page_number; $i++)
{?>
<a href = 'http://localhost/local/restaurants.php'
onclick='nav(<?echo
$i.",".$max.",".$min.",".$page_results.",".$page_number;?>);'><?echo
$i;?> </a>
<?}
And Here is the function:
<script language = "JavaScript">
<!--
function nav(pointer, maxx, minn, page_results, page_number)
//sets the min and max limits
{
maxx= pointer * page_results;
minn= maxx - page_results;
page_number = pointer; //change page number
//document.writeln("Do you really want to follow this link?"+maxx+'::'+
minn+'::'+ page_results+'::'+ page_number);
}
//-->
</script>
As you can see i've commented out a document.writeln which displays the
variables on a web page and increments them accordingly.
but there is nothing else on the web page when i use it.
ANy help would be appreciated
b
the next page in my database(similar to google's with numbers in the
middle for pages the user wants to jump to.
My only thought is i'm losing the parameters on page reload.
But if that is the case then I don't know the correct technique to keep
the variables
I am programming in php but using a javscript function with onclick.
I could use $_SESSION variables to retain the values in the page but i
shouldn't have to do that should I?
Here is the code:
for ($i=0; $i <= $max_page_number; $i++)
{?>
<a href = 'http://localhost/local/restaurants.php'
onclick='nav(<?echo
$i.",".$max.",".$min.",".$page_results.",".$page_number;?>);'><?echo
$i;?> </a>
<?}
And Here is the function:
<script language = "JavaScript">
<!--
function nav(pointer, maxx, minn, page_results, page_number)
//sets the min and max limits
{
maxx= pointer * page_results;
minn= maxx - page_results;
page_number = pointer; //change page number
//document.writeln("Do you really want to follow this link?"+maxx+'::'+
minn+'::'+ page_results+'::'+ page_number);
}
//-->
</script>
As you can see i've commented out a document.writeln which displays the
variables on a web page and increments them accordingly.
but there is nothing else on the web page when i use it.
ANy help would be appreciated
b