I'm trying to write a simple script to write some data to mysql then read it. My code is working without a problem alone but I'm trying to use it inside a WordPress page, this is the point problem starts.
I have created a template file for WordPress, and using this template to create the page. Page shows up without a problem but whenever I try to submit the form inside it (my custom php form) it forwards me to index.php .
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<span>Enter Your Code : </span><br/>
<input type="text" name="sha256"><br/>
<p align = right><input type="submit" name="shaSubmit" value="Submit" /></p>
</form>
this is my form (inside custom php), and as you can see it posts the data to itself. At the the start of my custom php code I have
if(isset($_POST['Submit']))
But it doesn't matter, as soon as I click on button, it forward me to domain.com/index.php
Btw, this custom php is on a page with such url domain.com/custompage/
How can make this form work ?
ps. Code above is for reading from mysql.