Ben bir metin kutusu ve bir Gönder düğmesi ile basit bir form istiyorum. Örneğin: Bir kullanıcı metin kutusuna "foobar" girer ve vurur girerseniz, onlar mysite.com / Tarama / filanca yönlendirilmesi gereken
Herkes php bunu biliyor mu? teşekkürler
Form:
<form action="index.php" method="get"> <input type="text" name="q" /> <input type="submit" /> </form>
index.php
header("Location: http://example.com/browse/".$_GET['q']);
Not: Bu iyi bir uygulama değildir ama çalışır.
Metin girişi için name='q' varsayarsak
name='q'
<?php if ($_GET['q'] === "foobar") { header("Location: http://example.com/browse/foobar"); } ?>