back forward button dosent work
Posted: Tue Jun 26, 2007 3:29 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello
i try a simple script to manage pages on my site
i just want to incress +1 on press forward and to -1 on press back
what i need to had so it will work
thanksCode: Select all
</head>
<body>
<form id="form1" name="form1" method="post" action="" target="_self">
<?php
$totalpages = '7';
if (!(isset($pagenum)))// if no pages select or the firs display will be page 1
{
$pagenum = '1';
}
if ($pagenum < '1') // if press back on page 1 stay in page 1
{
$pagenum = '1';
}
if ($pagenum > $totalpages) // if press forward on last page stay in last page
{
$pagenum = $totalpages;
}
echo "עמוש מספר ",$pagenum,"<BR>";
//----- check buttons-----------
if (isset($_REQUEST['back'])){
$pagenum--;
}
if (isset($_REQUEST['first'])){
$pagenum == '1';
}
if (isset($_REQUEST['last'])){
$pagenum = $totalpages;
}
if (isset($_REQUEST['next'])){
$pagenum++;
}
?>
<table width="200" border="1">
<tr>
<td colspan="4">עמוד <? echo $pagenum ; ?> מתוך <? echo $totalpages?></td>
</tr>
<tr>
<td>
<input type="submit" name="back" id="back" value="עמוד קודם" />
</td>
<td>
<input type="submit" name="first" id="first" value="עמוד ראשון" />
</td>
<td>
<input type="submit" name="last" id="last" value="עמוד אחרון" />
</td>
<td>
<input type="submit" name="next" id="next" value="עמוד הבא" />
</td>
</tr>
</table>
</form>
</body>
</html>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]