Free PHP Hostings – Bedava PHP Hostingler -MYSQL-PHP

Free PHP Hostings – Bedava PHP Hostingler – MYSQL Destekli Hostingler – PHP Destekli Hostingler – Bedava PHP Alan

Php ile sayfa çağırmak

Yazan: freephphosting Nisan 24, 2008

Php’de, aynı kodu bir çok sayfada tek tek yazmak yerine, bu kodu bir sayfaya kaydedip o sayfayı gereken yerlere çağırabiliriz. Php’de bu işlemi gerçekleştirmek için include() fonksiyonunu kullanıyoruz.
Örneğin index.php adında bir sayfamız olsun. Bu sayfaya alt_index.php sayfasını çağıralım.

<?php
echo “
Burası index.php sayfasıdır.
“;

include(”alt_index.php”);

?>

bu kod parçısıyla index.php ile aynı dizinde bulunan alt_index.php dosyasını çağırabilir. Eğer çağıracağımız dosya başka bir dizinde ise dizin yolunu da belirtmemiz gerekir.

Bir Yanıt “Php ile sayfa çağırmak”

  1. çok teşekkürler sağ olun

Yorum Yapın

XHTML: Bu etiketleri kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>