Using PHP include to separate site content

前端 未结 4 635
梦毁少年i
梦毁少年i 2020-12-03 16:17

I\'m looking for advice on the best practice for separating site content up into logical blocks. I want a header and footer that are constant throughout the site, so that if

4条回答
  •  孤城傲影
    2020-12-03 16:35

    index.php -- includes header, footer, and content based on REQUEST variable.
    header.php -- header content
    footer.php -- footer content

    content1.php, content2.php, etc.


    index.php:

    
    

    if you want the URL to go www.domain.com/pagename where the page you're trying to load into index.php is "pagename", use HTACCESS and do some URL Rewriting: http://corz.org/serv/tricks/htaccess2.php

提交回复
热议问题