多个相同的链接中的1个不起作用

时间:2019-06-04 22:12:50

标签: html mamp bitnami

因此,我在下面发布了多个链接,其中一个链接转到:localhost:8080/index.php(错误的链接)。其他的工作并转到正确的URL。他们都工作了一周没有任何问题。它们都应导航到localhost:8080/opdracht_4.2/index.php。他们都做了。

我尝试过:

<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>

很有趣,我尝试的最后一个链接(href='opdracht_4.2/index.php?)导航到localhost:8080/opdracht_4.2/opdracht_4.2/index.php

视图中的内容功能:

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'>    &euro; " . $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>";
    }
  }

我不明白这一点,也从未遇到过这个问题。

0 个答案:

没有答案