I wrote the following code in a page named : addSection.php
<from class="mainSettingsForm add" action="" method="post">
<h1>Add new section</h1>
<p>
<label>new section</label>
<input type="text" name="section_name" placeholder="section title">
<label>section status</label>
<select name="sectionStatus">
<option value="active">active</option>
<option value="disActive">disActive</option>
</select>
</p>
<p>
<label>section location</label>
<select name="sectionLocation">
<option value="Side">Side</option>
<option value="Body">Body</option>
</select>
</p>
<label>section description</label>
<textarea name="sectionDesc" placeholder="Section description"></textarea>
<input class="btn-primary" type="submit" name="submit" value="Add">
</from>
and the following code in a page named : Sections.php
<h2><a href="?page=sections&action=add">Add new section</a></h2>
<?php
if ($_POST OR @$_GET['action'])
{
if (isset($_GET['action']) AND $_GET['action']=="add")
{
include 'views/addSection.php';
if (isset($_POST['submit'])&&$_POST['submit']=="Add")
echo 'ok';
}
}
else
{
include 'views/sections.php';
}
?>
this statement if (isset($_POST['submit'])&&$_POST['submit']=="Add") echo 'ok'; is never be executed because it always gives false value , how can make isset($POST['submit']) statement gives true value to execute the condition ?
<form>...</form>
(not<from>
) – user1864610