One last problem is that I want to use it from web and cli both.
But when i use this getopt() function the webbrowser doesnt let me view the page, instead downloads the php file. CLI is workign fine now, how to solve this? The code is given below:
/
PHP Code:
/ If get is supplied use it
if ( isset($_GET['d']) )
$dispatch = $_GET['d'];
if ( isset($_GET['u']) )
$update = $_GET['u'];
// if no values provided in get use cli args
if ( $update != 'u' && $dispatch != 'u' )
{
//$args = getopt("u:d:");
if ( isset($args['u']) )
$update = $args['u'];
if ( isset($args['d']) )
$dispatch = $args['d'];
}
Bookmarks