在PHP页面中有一个GET请求超链接,它本身在跟随另一个类似的超链接时被调用

I have 3 PHP pages:

  1. My_posts.php
  2. ReaderBlog.php
  3. index.php

index.php is a default home page. All files are under the same folder called 'Better_blog' under htdocs in the XAMPP server.

Now in my_posts.php, I have a hyperlink like:

<a href="ReaderBlog.php?id=4">Goto Reader </a>

This triggers a GET request with parameter in URL to `ReaderBlog.php, in which it's able to decipher the GET request.

Now in ReaderBlog.php I have another GET request hyperlink to index.php like:

<a href="index.php">Click here to go to index page</a>

This link when clicked generates a URL like:

http://localhost/Better_blog/ReaderBlog.php/index.php

Which is incorrect behavior.

Instead, I expect:

http://localhost/Better_blog/index.php

Why is index.php getting appended to ReaderBlog.php?

Change the link to:

 <a href="ReaderBlog.php?id=4">Goto Reader </a>

Note the ? instead of /