Martijn Hermsen
Martijn Hermsen

Reputation: 31

XAMPP redirects to dashboard instead of desired page

So I am using XAMPP but when I click on a link it redirects me to localhost/dashboard instead of the page I want. How can I fix this?

This is the code of the index page

<!DOCTYPE html>
<html>
<head>
<title>SG Weredi</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="loginpagina.js"></script>
</head>
<body>


  <div class="header">
    <a href="/">Your App Name</a>
  </div>

  <div class="container-fluid">
    <img class =" logo" src="http://www.weredi.nl/logo.png">
  </div>

    <?php if( !empty($user) ): ?>

    <br />Welcome <?= $user['email']; ?> 
    <br /><br />You are successfully logged in!
    <br /><br />
    <a href="logout.php">Logout?</a>

  <?php else: ?>

    <h1>Please Login or Register</h1>
    <a href="Infproject/login.php">Login</a> or
    <a href="register.php">Register</a>

  <?php endif; ?>

</body>
</html>

Upvotes: 0

Views: 6811

Answers (2)

Avinash Thombre
Avinash Thombre

Reputation: 314

Try Changing port number to new one and restart the apache server. I changed port number from 8082 to 8084 and restarted the server. This worked for me.

Upvotes: 0

Dawid Gałecki
Dawid Gałecki

Reputation: 72

The only link that is correct is <a href="register.php">Register</a>.

You should do the same for login:

<a href="login.php">Login</a>

instead of

<a href="Infproject/login.php">Login</a>.

The same solution is for link to home page of project:

<div class="header"> <a href="./">Your App Name</a> </div>

instead of

<div class="header"> <a href="/">Your App Name</a> </div>

because href="/" on your site redirects you to index.php in C:/xampp/htdocs which redirects to C:/xampp/htdocs/dashboard/ (localhost/dashboard).

Upvotes: 1

Related Questions