SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: add numbers
-
May 9, 2005, 04:06 #1
- Join Date
- Apr 2005
- Location
- Auckland, New Zealand
- Posts
- 121
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
add numbers
hi im tryin to get my script so that when the address bar says ?offset=0 that my link will say offset=20 and when the addreess bar says ?offset=20 link says offset=40 and so on this is what ive got so far but it doesnt seem to work
echo "<br><br><p align=\"right\"><a href=\"?page=main&off= ($offset+20)\">Next 10</a> <a href=\"?page=main&off=0\">Prev 10</a></p>";
-
May 9, 2005, 04:14 #2
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It has to do with your formatting. Try this:
PHP Code:$nextoffset = $offset+20;
$prevoffset = $offset-20;
echo <<<EOF
<br>
<br>
<p align="right"><a href="?page=main&off={$nextoffset}">Next 10</a> <a href="?page=main&off={$prevoffset}">Prev 10</a></p>
EOF;
Quaint Tech - Blog on web development and web technology.
-
May 9, 2005, 04:26 #3
- Join Date
- Apr 2005
- Location
- Auckland, New Zealand
- Posts
- 121
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
that works perfectly thank you
-
May 9, 2005, 04:28 #4
- Join Date
- May 2004
- Location
- Netherlands
- Posts
- 219
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
sure thing chief
Quaint Tech - Blog on web development and web technology.
-
May 9, 2005, 04:35 #5
- Join Date
- Apr 2005
- Location
- Auckland, New Zealand
- Posts
- 121
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
another thing how would i go about only showing prev 10 if $offset was greater than 0? ive got this
if($offset >$h) {
echo "more than zero";
}
else {
echo "less"; }
but it wont work
-
May 9, 2005, 04:36 #6
- Join Date
- Apr 2005
- Location
- Auckland, New Zealand
- Posts
- 121
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
o and $h is set to 0
-
May 9, 2005, 04:47 #7
- Join Date
- Apr 2005
- Location
- Auckland, New Zealand
- Posts
- 121
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
sory bout dat i just figured it out thanx anyway :P
Bookmarks