I have a php page that submits to itself whenever a button is pressed and says
if (isset($_POST['submit'])) {
to run some mysql that inserts data into a table but gets that data by doing
$usercheck = $_POST['username'];
to gather the data.
I have an instance where I want to use <a href> instead of <input type='submit' and was curious how I would handle this. I know that I can handle it by giving <a href a long url like
<a href='<?php echo $_SERVER['PHP_SELF'];?>?submit=y&username=bob'
and then having something like
if (isset($_GET['submit'])) {
at the top of my page but isn't there an easier way to do this so that I don't have to pass all my input box data through a URL?