Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get the current url with query strings PHP

Posted on 2010-08-15
6
Medium Priority
?
283 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 84

Accepted Solution

by:
Dave Baldwin earned 1000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 31

Assisted Solution

by:Marco Gasi
Marco Gasi earned 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

715 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