Hello everyone,
I have a question regarding how to make a simple button with HTML and PHP. By clicking this button the number will be counted up every time it’s clicked.
I have been scouring the web and can either only find how to make this with a .txt file, using JavaScript/JQuery or any other programming language.
This is for an assignment and we’re not allowed to create any other files or use any other programming language.
As mentioned, only HTML and PHP are allowed, and it should be all in one file.
Besides giving the code (if possible), I would like to know why that code should be used. I’d like some explanation so I can understand it better too.
So far I’ve got this:
[php]<?php
if (isset($_GET[‘counter’])) {
$counter = $_GET[‘counter’];
}
else {
$counter = “0”;
}
?>
<!doctype html>
Counter [/php]