Solved

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

Posted on 2013-01-24
3
469 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
Comment Utility
<?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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now