Soham s More
Soham s More

Reputation: 95

Hiding GET parameters in php

I am working on local machine and my URL is:

http://localhost:91/GlobalVision/index.php?mm=1&sm=1 

     <? $mm=$_GET["mm"];
                 $sm=$_GET["sm"]; ?>
              <ul class="sidebar-menu">
                <li class="header">MAIN NAVIGATION</li>
                <li class=" <? if($mm==1) echo "active" ?>  treeview">
                  <a href="#">
                    <i class="fa fa-dashboard"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i>
                  </a>
                  <ul class="treeview-menu">
                    <li <? if($mm==1 && $sm==1) echo "class=\"active\"" ?>><a href="index.php?mm=1&sm=1"><i class="fa fa-circle-o"></i> Dashboard1</a></li>
                    <li <? if($mm==1 && $sm==2) echo "class=\"active\"" ?>><a href="index2.php?mm=1&sm=2"><i class="fa fa-circle-o"></i> index2</a></li>
                  </ul>
                </li>
</ul>

i have created this file as separate menu file and included in other php files. i wanted url as:

http://localhost:91/GlobalSDK/index

I tried writing:

^([a-zA-Z]+)/$ index.php?mm=$1&sm=$2 [L]

this rules in .htaccess file but it gives me error.

What should be the rule to achieve this. Even when index page get change it should display only page name not parameters. What should be the rule for this?

Upvotes: 0

Views: 51

Answers (1)

Abhishek Sharma
Abhishek Sharma

Reputation: 6661

Try these methods

1) Use a form and POST the information.

2) Use session variables to carry information from page to page.

3) Use "encoded" or non-sensical information in the QueryString in place of the real data.

Upvotes: 1

Related Questions