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
Diod
Forum Commoner
Posts: 52 Joined: Tue Oct 19, 2004 9:07 am
Post
by Diod » Tue Oct 19, 2004 10:05 am
Hey
I dont reallly know how to achieve the thing such as seen on many sites..
like index.php?act=del
i have the following currently
Code: Select all
if(isset($_GET['admin.php?act=post'])) {
}
if(isset($_GET['admin.php?act=edit'])) {
}
if(isset($_GET['admin.php?act=del'])) {
}
Last edited by
Diod on Tue Oct 19, 2004 12:25 pm, edited 1 time in total.
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Tue Oct 19, 2004 10:12 am
Code: Select all
<?php
if($_GET['act'] == 'add'){
//do something
}
elseif($_GET['act'] == 'edit'){
//do something
}
elseif($_GET['act'] == 'del'){
//do something
}
?>
Last edited by
John Cartwright on Tue Oct 19, 2004 10:13 am, edited 1 time in total.
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Tue Oct 19, 2004 10:13 am
Code: Select all
switch($_GET['act']) {
case 'post':
// do something
break;
case 'edit':
// do something else
break;
case 'del':
// ...........
break;
default:
header('Location: wrong_act.htm');
}
Diod
Forum Commoner
Posts: 52 Joined: Tue Oct 19, 2004 9:07 am
Post
by Diod » Tue Oct 19, 2004 10:16 am
thx.. both
Diod
Forum Commoner
Posts: 52 Joined: Tue Oct 19, 2004 9:07 am
Post
by Diod » Tue Oct 19, 2004 10:21 am
ah ok, ill use the switch then
thx