Hi I would like to know how to first post to a current page using the following code:
<?php
if(isset($_GET['button']) === true){
echo 'Albums';
}
?>
<form action="" method="post">
<input type="button" name="button" value="Albums">
</form>
I can’t seem to get the button when clicked to echo out Albums on current page?? But my main question was how can I achieve what I am trying to do without using a form just a link or button that can return an action using PHP? Is this possible with PHP alone? If not then how can I use whatever scripting is needed to return the PHP function?
You submit the data as post, so you have to check for POST.
Additionally I would either use
<input type="submit"or<button type="submit" name="button">Albums</button>.