Reputation: 41
I'm new to php and I have the following form in my html file:
<form id="loginForm" action="login.php" method="post">
<label for="username">Username:</label>
<div>
<input type="text" name="username" maxlength="255"/>
</div>
<label for="password">Password:</label>
<div>
<input type="password" name="password" maxlength="255"/>
</div>
<div class="buttonDiv">
<input type="submit" name="loginButt" value="Login"/>
</div>
</form>
Why does it try to open my php file when I try to run it? Open as in firefox opens a window asking me if I want to save or open the file.
Thanks
Upvotes: 3
Views: 5131
Reputation: 226
Probably you don't have the php server running. The form page displays correctly in the browser since the page file is a normal html file.
You'll see that if you try to execute the php file directly from the browser the same thing will happen.
An other thing that could be happening is that, in case you are using apache server, you are not loading the php apache module.
Upvotes: 0
Reputation: 7846
Make sure that you have PHP enabled. May sound stupid, but it's probably the solution.
Upvotes: 0