URL 2.0

Fevereiro 8, 2008

.htaccess

  1. DirectoryIndex ./index.php
  2. IndexIgnore */*
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^([0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?([0-9a-zA-Z_]*[\/]?[0-9a-zA-Z_]*)[\/]?$ http://www.exemplo.com.br/index.php?option=$1&1=$2&2=$3&3=$4&4=$5&5=$6&6=$7&7=$8&8=$9
  6. AddType image/gif .jpg

index.php

  1. <?php
  2. $i = 1;
  3. while ($i < 9){
  4.     $var_str = explode(”/”,$_GET[$i]);
  5.     if ($var_str[0] <> “”){
  6.         $GLOBALS[$var_str[0]] = $var_str[1];
  7.     }
  8.     $i++;
  9. }
  10. unset($i,$var_str);
  11. $option = $_GET["option"];
  12. ?>

Entry Filed under: PHP, Programação Web. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Tópicos recentes

Comandos e Funções

mais acessados

Comentários

andre luiz em Validar formulário em Jav…
Rafaela Poiani em Validar formulário em Jav…
Vanessa em Validar formulário em Jav…