I'm making a site using divs. I have one across the top with a row of links which I want to change what's in the main window. I would prefer to keep strictly to PHP and HTML and use a full page refresh as I am comfortable with them at current, rather than using an Ajax refresh as I don't have any knowledge of Ajax.PHP 변수를 <a href=""> link
I don't want to use iframes. I thought the best way to do this would be as follows:
<div id="top">
<a href="news.html">News</a>
</div>
<div id="main">
<?php include($page); ?>
</div>
What I need is a way of changing the $page
variable upon clicking the link. If this means changing the variable and then reloading the page then so be it.
A command following the logic of:
<a href="news.html" action="<?php $page="news.html"; ?>">News</a>
would be ideal! I thought about using a form, but it seems there should be an easier way.
여기 질문 새로운 HTML을로드하는 방법입니다되고 어떻게 생각/div의 PHP 페이지. jQuery의로드를 사용하여이를 수행 할 수있다. 비슷한 질문을 참조하십시오. [여기] (http://stackoverflow.com/questions/3564356/loading-html-page-inside-div?rq=1) –
변수를 구문 분석 할 필요가 없습니다. 현재 페이지는 $ _SERVER 배열이 될 것입니다. –
또는 목표 페이지를' 및'include ($ _ GET [ 'target']); ' –