| | |
Hide php page name in URL
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 12
Reputation:
Solved Threads: 1
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..!!
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..!!
•
•
Join Date: May 2008
Posts: 257
Reputation:
Solved Threads: 20
You meen the URLs look like
index.php?ID=1251341234
Etc.
index.php?ID=1251341234
Etc.
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
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:
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 Syntax (Toggle Plain Text)
<?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; } ?>
•
•
Join Date: Jun 2009
Posts: 119
Reputation:
Solved Threads: 2
•
•
•
•
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 Syntax (Toggle Plain Text)
<?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 Syntax (Toggle Plain Text)
<?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
php Syntax (Toggle Plain Text)
<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..!!
•
•
Join Date: Sep 2009
Posts: 43
Reputation:
Solved Threads: 9
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:
should be
and
should be
By the way I noticed a few errors:
php Syntax (Toggle Plain Text)
<li><a href="direct.php?pagepage=view">Call History</a></li>
php Syntax (Toggle Plain Text)
<li><a href="direct.php?page=view">Call History</a></li>
and
php Syntax (Toggle Plain Text)
<li><a href="direct.php?changepass.php">Change Password</a></li>
php Syntax (Toggle Plain Text)
<li><a href="direct.php?page=changepass">Change Password</a></li>
Last edited by edwinhermann; Sep 21st, 2009 at 5:34 am.
![]() |
Similar Threads
- How to 'refresh' a php page? (PHP)
- How we can use download button on a php page (PHP)
- How to hide query string in url with .htaccess (PHP)
- How do I output information from a PHP page to an HTML page? (PHP)
- Multiple SQL Queries in PHP page (PHP)
- login page and url (PHP)
- How to hide .php extension with url rewriting using .htaccess (PHP)
- Stuck inserting php page "include" (PHP)
Other Threads in the PHP Forum
- Previous Thread: Encrypt php code
- Next Thread: unexpected T_VARIABLE
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop parse paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source space speed sql structure subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web white xml youtube





