I'm trying to learn HTML and PHP so trying to build a login form with some links.
The bebsite opens OK, however the link to sign up seems to be going nowhere.
My index file as follows:
<?php
include ('../app/header.php');
?>
<section class="main-container">
<div class="main-wrapper">
<h2>Home</h2>
</div>
</section>
<?php
include ('../app/footer.php');
?>
And my header php as follows:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Welcome</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css">
</head>
<body>
<header>
<nav>
<div class="main-wrapper">
<ul>
<li><a href="/index.php">Home</a></li>
</ul>
<div class="nav-login">
<form>
<input type="text" name="uid" placeholder="Username\e-mail">
<input type="password" name="pwd" placeholder="password">
<button type="submit" name="submit">Login</button>
</form>
<a href="../app/signup.php">Sign up</a>
</div>
</div>
</nav>
</header>
The issue is that href
link to signup php takes me nowhere. However if I copy the files into public directory and change the path in the link it then works fine.
Also, after clicking signup link, my URL shows localhost\app\signup.php.
Im using xammp.
Could someone advise as to why the link does not work as expected?
Thanks
UPDATED:
My directory is as follows:
C:\xampp\htdocs\basicwebsite\public\index.php
and all PHP files are here:
C:\xampp\htdocs\basicwebsite\app