Home » Php » javascript – Anchor link from html page to PHP page

javascript – Anchor link from html page to PHP page

Posted by: admin February 25, 2020 Leave a comment


I’m trying to anchor link from my HTML page to PHP. But when I click on whatever the links download window of the page will appear. If I leave the link as an HTML file, the link to another page works properly, but with PHP it starts to download.

 <ul class="netflix-list">
        <li><a href="index-en.php">Home</a></li>
        <li><a href="index-en.php#about">About</a></li>
        <li><a href="index-en.php#services">Services</a></li>
            <li><a href="tattoo-en.html">Tattoo</a></li>
            <li><a href="beauty-en.html" class="gold">Beauty</a></li>
            <li><a href="piercing-en.html">Piercing</a></li>

        <li><a href="index-en.php#contact">Contact</a></li>
          <a href="beauty.html">Danish</a><img src="/images//denmark.svg" alt="danish-flag" class="flag" />
How to&Answers:

To run PHP files you need to be on a server like Apache, if you try to access .php files without a server that accepts php it won’t understand the request and will end up downloading the file.

You can Install WAMP or XAMPP(mac) and access your PHP files