27 Temmuz 2016 Çarşamba

PHP LOCATİON REFRESH KOMUTLARI(YÖNLENDİRME)

//location-refresh komutları (yönlendirme)
locationrefresh.php
<form action="gelen.php" method="post">
    Lütfen 1 ile 5 arasında bir numara girin <input type="text" name="numara"/>
    <input type="submit" value="göönder"/>
   
</form>

//gelen.php
<?php

$sayi=$_POST["numara"];
//echo $sayi;

if($sayi=="1"){
    echo "Yönlendiriliyorsunuz lütfen bekleyin";
    header("Location:Gonderilen.php");//beklemeden gonderilen.php dosyasına gider.
   
}  else {
    echo "Yönlendiriliyorsunuz lütfen bekleyin";
    header("Refresh:2;url=Gonderilen.php");    //2 saniye sonra gönderilen.php sayfasına git.
}

?>
//Gonderilen.php
Burası gönderilen php dosyası

Hiç yorum yok:

Yorum Gönder