I have one page which is divided into sections. Ιn each section I like to load a page. If I have a form and I click submit button or a link I like to show the results in this section.
For example: I am in section “item1_section2” which show the php page manage_team_teacher.php. In page manage_team_teacher.php I have a form, if I submit the form or click a link I like to show the results again in section “item1_section2”. I am very confused on how to carry this out because all is in the same page (index.php). I’m new in PHP and I need your help. what do you suggest?
As you can see I try a lot of methods but I have problems: I try to GET from URL the name of page (in category).
<a href="index.php?category=manage_team_teacher2.php&id_team=<?= $row['id_team']; ?>#item1_section2">manage</a></td>
above is an example of a link I tried to create
<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>
you need to also check that url is present
other wise if anybody set bla in url and it is not present than it causes