Solved

How to get the full http address and querystring from WordPress?

Posted on 2013-01-24
3
474 Views
Last Modified: 2013-01-24
I am trying to get the full http address including any querystrings, from a wordpress page (I am building a WP theme).

None of the $_REQUEST attempts I try work.

Here is the page I am working on: http://www.the1stdistrict.com/blog/final-election-results

Is there a way for me to query WP to get the full address listed above?
0
Comment
Question by:rascal
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 38815668
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>



http://www.phpeasystep.com/phptu/27.html
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 500 total points
ID: 38815682
When you run $_SERVER['HTTP_HOST']; you'll get result "www.apple.com" only, no "http://" no "/downloads/dashboard/email_messaging/todo.html"



When you run the script "$_SERVER['REQUEST_URI']" you'll get the result below.
no "http://" and no "www.apple.com

blog/final-election-results



hope that helps
0
 
LVL 1

Author Closing Comment

by:rascal
ID: 38815715
Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

735 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