Creating Links for Webpage Redirections
×
Home Courses Community Support
Creating Links for Webpage Redirections

In the video of this heading you have learned how to create a link/hyperlink and how to set the URL in simple way.

To create a link we use below code-

<a href="contact.php">Contact</a>


In the above code we use "Contact.php" as a path of file where it will redirect when user will click on Contact. When we will do it for live server then we will have to write complete URL like http://myweb/contact.php.
 

All the redirection made using same process. For example, we will give home page link on logo by using below code-

<a href="index.php"> <img src="logo.png"></a>


URLs

Let's take the example of contact page to understand the URLs. Our contact page is saved in main directory. And it's URL at local host is http://localhost/myweb/contact.php

We can get this page from URL http://localhost/myweb/contact too. To do so, we need to make little changes in our folder and file name.
Follow below process-

  • In root directory (myweb) create a new folder.
  • Rename that folder by name contact
  • Move contact.php file to contact folder
  • Rename the file to index.php
  • You have done.


Now you can get the page without using .php extension. Apart from above method we can change URLs by URL-Rewriting method.

 

 

← Preview

Build Web Pages

Next →

Simple form Submission

NOTES

Our mission is to provide highly effective and quality education via innovative solutions. Geeksdemy look forward to bridge the gap between in-demand technology and academics in order to deliver innovative, easy, interesting and affordable learning across the Globe.

Courses

  • Python
  • Game Development with Unity 3D
  • Arduino
  • PCB & Circuit Designing
  • Robotics and Embedded C
  • 8051/8052 Embedded Systems
  • QuadCopter & UAV
  • MATLAB with Robotics
  • Raspberry Pi
Learn On the Go!
Get the Android App
Get the iOS App