add_url($longurl) ) { if ( REWRITE ) // mod_rewrite style link { $url = 'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'.$lilurl->get_id($longurl); } else // regular GET style link { $url = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].'?id='.$lilurl->get_id($longurl); } $msg = '

Seu link é: '.$url.'

'; } elseif ( !$protocol_ok ) { $msg = '

Invalido!

'; } else { $msg = '

FAIL!.

'; } } else // if the form hasn't been submitted, look for an id to redirect to { if ( isSet($_GET['id']) ) // check GET first { $id = mysql_escape_string($_GET['id']); } elseif ( REWRITE ) // check the URI if we're using mod_rewrite { $explodo = explode('/', $_SERVER['REQUEST_URI']); $id = mysql_escape_string($explodo[count($explodo)-1]); } else // otherwise, just make it empty { $id = ''; } // if the id isn't empty and it's not this file, redirect to it's url if ( $id != '' && $id != basename($_SERVER['PHP_SELF']) ) { $location = $lilurl->get_url($id); if ( $location != -1 ) { header('Location: '.$location); } else { $msg = '

ERRO 171.

'; } } } // print the form ?> <?php echo PAGE_TITLE; ?>

Powered by AmauriKnx