Solved

Get the current url with query strings PHP

Posted on 2010-08-15
6
277 Views
Last Modified: 2012-05-10
How to get the current url with query strings?

I tried  PHP_SELF didn't work :(
0
Comment
Question by:sahanz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 33439631
What have you done, exactly? PHP_SELF or $_SERVER['PHP_SELF']?
0
 
LVL 1

Author Comment

by:sahanz
ID: 33439632
$_SERVER['PHP_SELF']
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 33439637
Looks like on this Windows IIS machine you need two $_SERVER variables to get everything.  Looks like that should work on Linux/Apache also.
$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 31

Assisted Solution

by:Marco Gasi
Marco Gasi earned 250 total points
ID: 33439639
Take a look at this function http://www.webcheatsheet.com/PHP/get_current_page_url.php

You can also use $_SERVER['REQUEST_URI'] but I'm not sure (never used :-))

Hope this helps
0
 
LVL 1

Author Closing Comment

by:sahanz
ID: 33439644
Its apache and $_SERVER['REQUEST_URI'] gives the URL with query
0
 
LVL 1

Author Comment

by:sahanz
ID: 33439647
and thanks btw :)
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question