Okay, so I'm practicing website programming and I have learnt the basics of PHP and HTML. As my first task I decided to try something with medium difficulty, - create a coinflip program. Within my file I have HTML code and PHP code, however when I run this code in the browser, it appears to show the PHP code and not to specifically what I told it to. Whether i've done something wrong I don't know. Please help me point out the errors and where to fix the problem if you know, thanks.
HTML & PHP:
<!DOCTYPE html>
<html lang="en">
<body>
<link rel="stylesheet" type="text/css" href="coinflip.css">
<title>Coinflip | 50/50!</title>
<h1><Coinflip</h1>
<div class="circle">
<?php
$flip = 0;
$winner = rand(0,1)
if ($winner = 0) {
echo "<p>The Coin Landed On Tails!</p>"
}
else {
echo "<p>The Coin Landed On Heads!</p>"
}
?>
</div>
</body>
</html>
CSS:
.h1 {
font-family: Arial, Verdana, sans-serif;
text-align: center;
color: black;
}
.cirlce {
border-radius: 50%;
width: 200px;
height: 200px;
}
I have yet to add text inside of the circle etc yet, help would be appreciated.
JSFiddle: https://jsfiddle.net/6nLwL08k/