I have a project which i developed using WAMP. The project works fine as expected. I tried to use the same project on LAMP stack (Ubuntu 14.04). I imported the database to mysql server and then copied the files to /var/www/html folder and gave permissions using chmod to all files in www folder. When trying to access the project using the localhost login page appears and the links on login page (register and contact pages) works fine.
But when trying to login using the username and password it give an 404 page not found error. but the page which was in the error message is available in the physical folder at the exact location.
what can be the reason for that?
<form role="form" name="loginform" action="mypages/components/login-process.php" method="post">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Username" name="username" autofocus>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<!-- Change this to a button or input when using this as a form -->
<button type="submit" class="btn btn-lg btn-success btn-block" value="Log In" name="login_button"> Login</button>
<br>
<a class="login" href="mypages/stu/sturegform.php">Register as Student</a>
</fieldset>
</form>
mypages/stu/sturegform.php it displays the page but the form action gives 404 error
The issue is here itself is your action.
If you're configuring in a UNIX environment either use the full path or the recursive path.
action="mypages/components/login-process.php"
If your myPages
is in the same directory just put the PHP name or else you could use the full path as :
action="/var/www/html/mypages/components/login-process.php"
or if your path is a recursive path, you can use this way:
action="./mypages/components/login-process.php"
PS it applies to here also : href="mypages/stu/sturegform.php"
Your action and your form are not at the same level.
Your code is looking the login script at
mypages/stu/mypages/components/login-process.php
Change the action to
../components/login-process.php