セクションに分割された 1 つのページがあります。各セクションで、ページを読み込むのが好きです。フォームがあり、送信ボタンまたはリンクをクリックすると、このセクションに結果が表示されます。
例: 私はセクション「item1_section2」にいて、php ページを表示していますmanage_team_teacher.php
。ページ manage_team_teacher.php にフォームがあり、フォームを送信するかリンクをクリックすると、セクション「item1_section2」に結果を再度表示したいと思います。すべてが同じページ ( ) にあるため、これを実行する方法について非常に混乱していますindex.php
。私はPHPが初めてで、あなたの助けが必要です。何を指示してるんですか?
ご覧のとおり、私は多くの方法を試していますが、問題があります: URL から (カテゴリ内の) ページの名前を取得しようとしています。
<a href="index.php?category=manage_team_teacher2.php&id_team=<?= $row['id_team']; ?>#item1_section2">manage</a></td>
上記は私が作成しようとしたリンクの例です
<div class="content" style="font-size:30px;">
<div class="section black" id="item1_section1" style="float: left; overflow: scroll; padding: 30px 0 0 30px; width: 869px;">
<h2>Section 1</h2>
<p>
sdffffffffffffffffffffffffff
sdffffff
sdf
</p>
<ul class="nav">
<li>1</li>
<li><a href="#item1_section2">2</a></li>
<li><a href="#item1_section3">3</a></li>
</ul>
</div>
<div class="section white" id="item1_section2" style="float: left; overflow: scroll; padding: 30px 0 0 30px; height:690px; width: 869px;">
<h2>Section 2</h2>
<p>
<?php
include "includes/tests/multiple_choice.php";
?>
</p>
<ul class="nav">
<li><a href="#item1_section1">1</a></li>
<li>2</li>
<li><a href="#item1_section3">3</a></li>
</ul>
</div>
<div class="section black" id="item1_section3">
<h2>Section 3</h2>
<p>
‘He scents thy footsteps in the snow
Wheresoever thou dost go,
Thro’ the wintry hail and rain.
When wilt thou return again?
</p>
<ul class="nav">
<li><a href="#item1_section1">1</a></li>
<li><a href="#item1_section2">2</a></li>
<li>3</li>
</ul>
</div>
</div>
</div>
<!--########################--ITEM 2--########################-->
<?php if ($row['settings_key'] == background-color){
echo '<div id="item2" class="item" style="background-color: #'.$row['settings_value'].';">';
}?>
<a name="item2"></a>
<div class="content" style="font-size:30px;">
<div class="section black" id="item2_section4" style="float: left; overflow: scroll; font-size: 18px; padding: 30px 0 0 30px; height:690px; width: 869px;">
<ul class="nav" style="float: left;">
<li>1</li>
<li><a href="#item2_section5">2</a></li>
<li><a href="#item2_section6">3</a></li>
</ul>
<h2>Section 1</h2>
<p>
<?php
include "create_new_team_teacher.php";
?>
</p>
</div>
<div class="section white" id="item2_section5" style="float: left; overflow: scroll; font-size: 18px; padding: 30px 0 0 30px; height:690px; width: 869px;">
<h2>Section 2</h2>
<p>
<?php
if(isset($_GET['category'])){
// include page about me
include($_GET['category']);
//else if is defined URL variable 'interests'
} else {
include('manage_team_teacher.php');
}
?>
</p>
<ul class="nav">
<li><a href="#item2_section4">1</a></li>
<li>2</li>
<li><a href="#item2_section6">3</a></li>
</ul>
</div>
<div class="section black" id="item2_section6">
<h2>Section 3</h2>
<p>
‘He scents thy footsteps in the snow
Wheresoever thou dost go,
Thro’ the wintry hail and rain.
When wilt thou return again?
</p>
<ul class="nav">
<li><a href="#item2_section4">1</a></li>
<li><a href="#item2_section5">2</a></li>
<li>3</li>
</ul>
</div>
</div>
</div>