I have a login form with an action heading to the con_login.php file. When the con_login.php is under the same folder as the current page everything works fine. But i want the file to be under another folder, so when instead of action="con_login.php" i move the file and i type action="../functions/con_login.php" it doesn't work. When i press submit the browser looks for the con_login.php under the same folder as the login_page.php. How can i fix that?
<?php
$title="WebVillas - Welcome";
require('../parts/header_welcome.php');
?>
<main id="main">
<h2>Home Page</h2>
<?php echo_msg(); ?>
<?php if(!isset($_SESSION['username'])) { ?>
<p>Please login:</p>
<form name="form1" method="post" action="../functions/con_login.php">
<p>username: <input type="text" name="username"/> </p>
<p>password: <input type="password" name="password"/> </p>
<p><input name="submit" type="submit"></p>
</form>
<?php } else echo '<p> Hello ' .$_SESSION['username'].'</p>';?>
</main>
</div>
<?php require('../parts/footer_welcome.php'); ?>