I have 3 PHP pages:
My_posts.php
ReaderBlog.php
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 /