My class is learning coding. It does not go over php, so I am trying to learn it myself. We use jsbin and cloud9. Cloud9 is very nice but I am having trouble using it. I want to follow along with a specific tutorial.
this is the tutorial for php. http://www.chickensmoothie.com/tutorial/tut2/index.html
I have made a html file and a php file, with the same code. This is the code:
<!DOCTYPE html>
<html>
<body>
<h1>My first page</h1>
<?php
//Tell the browser that we are sending it a PNG image to display
header("Content-Type: image/png");
//Echo the contents of the image file called "dogbaby.png" to send it to the browser
readfile("/images/pets/dogbaby.png");
?>
</body>
</html>
end script
If I save it as an html file it displays "first page" just fine, but not the php image when I preview the webpage. the tutorial clearly states that when it works you should be able to see the image, and that if you do not see an image it has gone wrong. So then I saved it as a php file. I click the same run and preview button that correctly displays a webpage for an html file's preview. yet, instead of displaying a website it opens a blank page AND downloads a text file to my desktop. the text file is the actual php text.
does anyone know how to preview php in cloud9, or any website that is specifically for writing/testing php?