使用XAMPP在浏览器中打开Php文件时遇到问题

I have simple PHP code:

<form action="demo.php" method="post" />
 <p>Input 1: <input type="text" name="input1" /></p>
 <input type="submit" value="Submit" />
 </form>

Then when I right click it, hover over 'open with' with my mouse, Safari isn't a recommended application. (I am on OS X). I have installed XAMPP. Then I followed an answer on another question on here, and it still didn't work. I found the XAMPP folder, the htdocs, then I made a folder named php that had my form.php file. Then, I got in Safari, and typed: http:/localhost/form.php, and it still did not work. What am I doing wrong?

you have to type the url http://localhost/php/form.php, in the browser to open the above form.