I am trying to add a simple ‘I Like This’ text button to pieces of my work. When the user clicks the ‘I like this’ button, I want a number to be recorded right next to the button, showing the total number of ‘likes’ so far. This is the first time I am using PHP to do anything, so I am completely lost - I can’t get any click counter to work that is simple enough for what I want to do and that will work without a MySQL database.
CODE IN MY HTML PAGE (index.html):
I like it! <?php include("counter.php"); ?>
CODE IN MY PHP FILE (counter.php)
$filename = “counter.txt”;
$file = fopen ($filename, “w”) or die (“Cannot find $filename”);
TEXT FILE SAVED IN THE SAME DIRECTORY (counter.txt)
I think I might be calling the php file incorrectly in the my html page?
Can anyone help me? I am going to kill myself. Thanks