• 02-01-2014, 09:46:13
    #1
    Merhabalar,

    Htaccess ile veya nasıl yaparım?

    watch?v=DEGER

    watch diye klasör açıp yapıyorum ama saçma oluyor biraz basit yoldan nasıl halledebilirim?
  • 02-01-2014, 11:02:02
    #2
    .htaccess
    #AddDefaultCharset utf-8
    #Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    ReWriteRule ^watch(/?)$	watch.php [L,NC]
    watch.php
    <?php
    if(isset($_GET['v'])){
    	$v = $_GET['v']; //güvenlikten geçirmeyi unutma
    	echo $v;
    }
    ?>
  • 02-01-2014, 11:05:57
    #3
    $_GET[] değişkeni işe almanız gerekir.

    http://sitem.com/index.php?test=1

    $_GET['test'] değeri "1" olur.

    <?php
    print($_GET["test"]);
    ?>
    Sonuç:
    1