php form return page request_uri

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    php form return page request_uri

    hii guys i have a small problem.i have a page with parameters passed in url .i use POST method in the page and action=PHP_SELF . After submissions i want to return to same page .But the parameters in URL are causing probs.So how to get this done..
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if you're in the base directory you can use $_SERVER['REQUEST_URI'] otherwise use $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'].

    you can look at the available $_SERVER variables in the phpinfo() file.

    regards

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Can you elaborate on the 'probs', i.e. tell us what they are?

      Thanks,
      Markus.

      Comment

      • pradeepjain
        Contributor
        • Jul 2007
        • 563

        #4
        Originally posted by Markus
        Can you elaborate on the 'probs', i.e. tell us what they are?

        Thanks,
        Markus.
        the prob is that ,i am passing few variables by url to a page which is a form and the submit action needs to be set something like tht so that it come to same page after submitting.I tried request_uri also but it comes to the page with no action.URL is what i need but its not executing when i use REQUEST_URI.... ..Hope i am clear

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          if it's coming to the same page, then REQUEST_URI definitely worked. maybe there's something screwed up in the script?

          Comment

          Working...