Home > Software engineering >  Linking a PHP page in HTML
Linking a PHP page in HTML

Time:05-23

I am building a website and have all pages in HTMl. My final page is the contact page which I will need to create in php. Can I simply link the php file in my nav bar?

<nav>
    <ul>
        <li><a  href="index.html">Home</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.php">Contact</a></li>. <!-- Would this line work? -->
   </ul>
</nav>

CodePudding user response:

You can try something like this. If your code doesn't work.

href="/contact.php" or href="www.yourwebsite.com/contact.php.

But I would suggest you put a php code on your server to remove the .php in the end. So it is clean.

CodePudding user response:

You can just try to put the URL in button href="/contact.php" or href="www.yourwebsite.com/contact.php. or can use include method

  • Related