Please keep in mind I am a beginner so please don't be too harsh.
I have spent hours researching ways to complete my 'mission'.
My mission is as follows... 1. I open my already created html web page 2. I click on the submit button 3. The submit button should execute PHP code. 4. The PHP code should write the current date and time to a .txt file located on my desktop without overwriting previous records.
My HTML page works perfectly fine. The submit button appears and when clicked it displays all the code from the .php file but doesn't actually run it. Even if it were to run the code I'm not sure if the code would work?
Could you please tell me why when I click on the button it displays the PHP code but doesn't run it. By the way, sorry I should have mentioned I was using Google Chrome. I can settle for IE if necessary but would prefer Chrome.
Here is the HTML file code
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<form method="post" action="submit.php">
<input name="submit" type="submit" value="Connect" />
</form>
</body>
</html>
Here is the PHP code
<?php
$file='phplog.txt';
$date= date('d-m-Y H:i:s');
file_put_contents($file, $date, FILE_APPEND);
?>
I checked the pre-created by me phplog.txt file and it was empty so... I don't know...
Please don't forget I would prefer this to work in Chrome :) Any help would be greatly appreciated!
Thanks :)