Help with alias script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Help with alias script

Post by JKM »

Hi there!

Could anyone help me out with a alias script?
"alias page2 -> should show start=50"
"alias page3 -> should show start=75"
"alias page4 -> should show start=100"
and so on. :-)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Help with alias script

Post by John Cartwright »

What is an alias script? Can you explain what you are after more please?
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: Help with alias script

Post by JKM »

It's used in mirc scripting (f.i. alias q { quit }). I've got a dvd database, where it's start=25/start=50 and so on. But I wan't to make it look a little better. So dvddb.php?order=rating&page=2 (should actually show dvddb.php?order=rating&start=50).
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Help with alias script

Post by John Cartwright »

Code: Select all

$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
if (!$start) {
   $page = 1;
}
$start = $page * 25;
So all you want to do is multiply the page number by 25?
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: Help with alias script

Post by JKM »

Yes - thx! :-)
Post Reply