Search the Community
Showing results for tags 'yönlendirme'.
-
Merhaba arkadaşlar index.php sayfasında Session oluşturup, sayfa2.php'de listelettiriyorum. Ama ben session'ı oluşturduktan sonra otomatik olarak sayfa2.php'ye yönlendirme yapmasını istiyorum, nasıl yapabileceğim konusunda bana yardımcı olabilirseniz çok sevinirim. Teşekkürler. index.php <?php session_start(); ?> <!doctype html> <html> <head> <title>Session Oluştur</title> </head> <body> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Ürün Adı :<input type="text" name="urunadi"> Alış Fiyati :<input type="text" name="alisfiyati"> Müşteri Adı :<input type="text" name="musteriadi"> <input type="submit" name="submit" value="Submit"> </form> <br> <a href="sayfa2.php">2.Sayfaya Git </a><br> <a href="sayfa3.php">3.Sayfaya Git </a> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $_SESSION['uadi']=$_POST['urunadi']; $_SESSION['afiyati']=$_POST['alisfiyati']; $_SESSION['madi']=$_POST['musteriadi']; } ?> </body> </html> sayfa2.php <?php session_start(); ?> <!doctype html> <html> <head> <title>Session Listeleme</title> </head> <body> <?php if(isset($_SESSION["uadi"])&&isset($_SESSION["afiyati"])&&isset($_SESSION["madi"])) { ?> Ürün Adı : <?php echo $_SESSION['uadi']; ?><br> Alış Fiyatı : <?php echo $_SESSION['afiyati']; ?><br> Müşteri Adı : <?php echo $_SESSION['madi']; }?><br> <a href="index.php">1.Sayfaya Git </a> </body> </html>