I am trying to make this code works, but I always received a NULL value from $_GET["page"]
<div class="menu">
<ul class="admin-menu">
<?php if (isset($_GET["page"])) : ?>
<?php if ($_GET["page"] == "opt1") : ?>
<li class="menu-item">
<a class="item-link" href="option1" name="opt1">Altas</a>
</li>
<br>
<?php endif ?>
<?php if ($_GET["page"] == "opt2") : ?>
<li class="menu-item">
<a class="item-link" href="baja" name="baja">Bajas</a>
</li>
<br>
<?php endif ?>
<?php endif ?>
</ul>
</div>
<!-- Working area -->
<div class="working">
<?php
if (isset($_GET["page"])) {
if (
$_GET["page"] == "opt1" ||
$_GET["page"] == "opt2"
) {
include "admin/admin.".$_GET["page"].".php";
}
} else {
include "view/pages/system/error404.php";
}
?>
</div>
and this is my .htaccess file
Options All -Indexes
RewriteEngine on
RewriteRule ^([-a-zA-Z0-9/]+)$ index.php?page=$1
I really don't know what to do, I saw a lot of examples on line but not luck
thank you for any help
index.php?page=opt1?<form>tags. Also, I don't think an<a>element works as a form element. You also don't have any elements with thenameattribute set topage. Also, the code in your<div class="working">block looks like it has syntax errors. Also, you your HTML is invalid, you never end the first<div class="menu">element.