PHP wildcard
Posted: Thu Dec 07, 2006 5:13 pm
Everah | Please use
in this I want the * to be anything. This script takes teh URL's variable (L) and decides weather to echo the admin sidebar. I want the following to be acceptable for showing the Admin sidebar:
?l=admin
?l=admin/errorlogs
?l=admin/user
although I do not want to list these manually so I want
to work. Thanks!
Everah | 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]
OK this is a little confusing but bear with me:
Let me show the code then explain:Code: Select all
$url = $_GET['l'];
if($url =='admin' or $url=='admin/*')
{
echo '<div id="sidebar">';
guav_admin_sidebar();
echo '</div>';
}?l=admin
?l=admin/errorlogs
?l=admin/user
although I do not want to list these manually so I want
Code: Select all
if($url == 'admin' or $url == 'admin/ANYTHING')Everah | 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]