i m new to php.. i have seen in many php sites...!! if jump from one page to another... it does shows the page name..!! URL remains at Index page..!! Only page changes..!!

as i work..!! if i jump from one page to another..! Url also changes from page to page..!!
.
.
i just want tht i dont to show which i m calling in URL..!!
.
.
i hope everyone understand what exactly i want to say..!! :)
.
.
thanks in advance..!! :)

I can think of three reasons:

  1. Pages are served within a Frameset
  2. Content is controlled by the quesry string (as per samarudge's post above)
  3. URL is "mapped" (as with eg. Zend Framework's "rewrite router")

Airshow

You can use a couple of things with this.

Read about URL Rewriting (a bit advanced thing, but you can try). Or search on this forum, you will get somethng about URL Rewriting using .htaccess.

Other option, where only index page shows, you can put your pages dynamic.
For eg: you have 4 pages, Home,About Us, Services, Clients

So you can have your url as :
index.php?page=home
index.php?page=about
index.php?page=services
index.php?page=clients

For php, you can create your pages separately and then you can create an index page with the below like code:

<?php

$page = $_GET['page'];

switch($page)
{
    case 'home': include("home.php");
    break;
    case 'about': include("about_us.php");
    break;
    case 'services': include("services.php");
    break;
    case 'clients': include("clients.php");
    break;
    case default: include("home.php");
    break;
}
?>

You can use a couple of things with this.

Read about URL Rewriting (a bit advanced thing, but you can try). Or search on this forum, you will get somethng about URL Rewriting using .htaccess.

Other option, where only index page shows, you can put your pages dynamic.
For eg: you have 4 pages, Home,About Us, Services, Clients

So you can have your url as :
index.php?page=home
index.php?page=about
index.php?page=services
index.php?page=clients

For php, you can create your pages separately and then you can create an index page with the below like code:

<?php

$page = $_GET['page'];

switch($page)
{
    case 'home': include("home.php");
    break;
    case 'about': include("about_us.php");
    break;
    case 'services': include("services.php");
    break;
    case 'clients': include("clients.php");
    break;
    case default: include("home.php");
    break;
}
?>

I m Sorry for late reply and thanx for ur Response..!!
.
.
I tried your code.... but i m unsuccessful up till now..!! :(
.
.
i made a direct.php

<?php
      $page = $_GET['page'];
      switch($page)
      {
        case 'welcome': include("welcome.php");
        break;
        case 'view': include("view.php");
        break;
        case 'payment': include("payment.php");
        break;
        case 'tariff': include("location:traiff.php");
        break;
        case 'changepass': include("changepass.php");
        break;
        default : include("welcome.php");
        break;
      }
  
      ?>

and in menu.php (this menu bar of the page)
i did this

<ul id="menu" class="cleaning-box">
            
<li><a href="direct.php?page=welcome">Home</a></li>
<li><a href="direct.php?pagepage=view">Call History</a></li>
 <li><a href="direct.php?page=payment">Payments</a></li>
        <li><a href="direct.php?page=tariff">Tariff</a></li>
        <li><a href="direct.php?changepass.php">Change Password</a></li>
        <li><a href="logout.php">Logout</a></li>
        </ul>
     </body>   
   </html>

kindly tell where i m wrong..!!! i m unable to get the result..!! :(

Do the pages welcome.php, view.php, payment.php etc exist? You need to create them too.

By the way I noticed a few errors:

<li><a href="direct.php?pagepage=view">Call History</a></li>

should be

<li><a href="direct.php?page=view">Call History</a></li>

and

<li><a href="direct.php?changepass.php">Change Password</a></li>

should be

<li><a href="direct.php?page=changepass">Change Password</a></li>

Edited 7 Years Ago by edwinhermann: n/a

This article has been dead for over six months. Start a new discussion instead.