So I have multiple links as posted below, 1 of them goes to: localhost:8080/index.php
(wrong one). The others work and goes to the correct url. All of them worked for a week without any problems. They should both navigate to localhost:8080/opdracht_4.2/index.php
. Which they all did.
I tried:
<a class='add-product-link' href='../index.php?page=admin'>Add product</a>
<a class='add-product-link' href='./index.php?page=admin'>Add product</a>
<a class='add-product-link' href='opdracht_4.2/index.php?page=admin'>Add product</a>
Funny enough, the last link I tried (href='opdracht_4.2/index.php?
) navigated to localhost:8080/opdracht_4.2/opdracht_4.2/index.php
.
content function in view:
protected function mainContent() {
if ($this->shopModel->allowedToAddOrEdit) {
echo "<a class='add-product-link' href='index.php?page=admin'>Add product</a>";
}
foreach($this->shopModel->products as $product) {
echo "<div class='shop-item'>";
echo "<a href='index.php?page=details&product=" . $product['productId'] . "' class='product-name'>" . $product['productName'] . "</a><br>";
echo "<img src='" . $product['imgUrl'] . "' alt='" . $product['productName'] . "' height='100' width='100' class='product_img'> <br>";
echo "<span class='price'> € " . $product['price'] . "</span>";
if ($this->shopModel->allowedToBuy) {
echo "<a href='index.php?addedItem=" . $product['productId'] . "&page=shop'><button class='add-to-basket'>Add to cart</button></a><br><br>";
}
if ($this->shopModel->allowedToAddOrEdit) {
echo "<a href='index.php?page=admin&product=".$product['productId']."' class='add-product-link'>Edit</a>";
}
echo "</div>";
}
}
I fail to understand this and have not ever encountered this issue.