Passing value with out variable in query string in PHP

Discussion in 'PHP' started by Ali_GGL, Nov 29, 2008.

  1. #1
    Hi all here at forum.
    I am working to find out some solution to access a web page in PHP that is showing information on the bases of given argument in query string variable. My problem is this that I want to get the value of variable in query string but I don’t want to show the variable name and also want to hide the page name like below urls are opening fine.

    globalguideline.com/JavaScript_Guide/JavaScript_Examples.php?JScript=first_JavaScript
    globalguideline.com/JavaScript_Guide/JavaScript_Examples.php?JScript=JavaScript_HelloWorld
    globalguideline.com/JavaScript_Guide/JavaScript_Examples.php?JScript=HTML_With_JavaScript

    But I want to open the same pages as below urls instead of above all.

    globalguideline.com/JavaScript_Guide/first_JavaScript
    globalguideline.com/JavaScript_Guide/JavaScript_HelloWorld
    globalguideline.com/JavaScript_Guide/HTML_With_JavaScript
    :confused:
    Is it possible in PHP if yes then please help me to get out from this problem.
    Regards,
    Ali.
     
    Ali_GGL, Nov 29, 2008 IP
  2. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #2
    you need .htaccess
    and your hosting/server must enable to rewrite engine...
     
    misbah, Nov 29, 2008 IP
  3. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #3
    This is called search engine friendly URLs or URL rewriting.

    As misbah already told you that you can do this with .htaccess and Apache. Which is enabled by default in CPanel hosting environment. Here is a good article to start with URL rewriting (http://corz.org/serv/tricks/htaccess2.php).
     
    mwasif, Nov 29, 2008 IP
  4. Ali_GGL

    Ali_GGL Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hello is this file .htaccess is must to edit if some hosting is not allowing us to edit this file.
    :confused:
     
    Ali_GGL, Dec 3, 2008 IP