Zend - The PHP Company




Menus & Navigation

Add Code


PHP-ACTION WRAPPER 0.2  

Type: code fragment
Added by: steo
Entered: 13/07/2003
Last modified: 07/12/2002
Rating: - (fewer than 3 votes)
Views: 4049
PHP code for easy pass a long list of boolean variable over the pages.


<?
print '<B>QUERY_STRING</B>: <I>'.getenv('QUERY_STRING').'</I><BR><BR>';

$subaction = array();

if (isset(
$_REQUEST['action'])) 
    {
    
$subpos strpos($action'.');
    if (
$subpos
        {
        
$subaction explode('.'substr($action$subpos+1));
        
$action substr($action0$subpos);
        for (
$i 0$i count($subaction); $i++) $subactionvar[$subaction[$i]] = TRUE;
        
extract ($subactionvarEXTR_PREFIX_ALL'subaction');
        }
    } 
else 
    
$action 'default';

print 
'<b>Action:</b>'.$action.'<BR><BR>';

if (
$subaction
    for (
$i 0$i count($subaction); $i++) 
        print 
"<DL><DT><b>SubAction[$i]:</b> $subaction[$i] <DD>$subaction_$subaction[$i] = TRUE</DL>";
?>


Usage Example


See the example


Rate This Script





Search



This Category All Categories