Evet arkadaşlar bu soru çok soruluyor bende anlatayım dedim. Böyle link nasıl yapabiliriz. SWİTCH ile yapıyoruz burda. Örnek dosyalar ektedir arkadaşlar kodları orda inceleyebilirsiniz.
Önce bas.php diye dosya oluşturalım içine kod filan eklemeyin normal şu kodlar dursun:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
sonra 1.php diye dosya oluşturun
<h2 align="center"> 1. SAYFA KARACODER</h2>
sonra 2.php diye dosya oluşturun
<h2 align="center"> 2.SAYFA kARACODER</h2>
sonra 3.php diye dosya oluşturun bu önemli
<ul>
<li> <a href="adres.php?git=1">1.link</a>
<li> <a href="adres.php?git=2">2.link</a>
</ul>
sonra adres.php oluşturuyoruz ve içine şunları koyuyoruz
<?php
include "bas.php" ;
switch ($git) {
case "1";
include "1.php";
break;
case "2";
include "2.php";
break;
default:
include "3.php";
}
print "</body> \n</html>\n";
?>adres.php'yi çalıştırdığımızda linklerin çalıştığını göreceğiz.