[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

Send current WordPress page in a URL parameter

Hi - I'm trying to insert a URL parameter in a link on about 600 pages. I'm hoping I can pull the current page URL and append this on-page link with a URL parameter.

The point is to use Gravity forms to pull the referring page when someone is filling out the form - not the current page mind you, but the page that sent them to the form page. Gravity Forms can do that via a URL parameter.

What would be the syntax for adding the current page URL as a URL parameter in WordPress? Specifically in the page or post editor would be ideal.

Thanks

Bill
0
billium99
Asked:
billium99
  • 2
1 Solution
 
Ray PaseurCommented:
The current URL is (usually) available in $_SERVER['HTTP_HOST'] + $_SERVER['REQUEST_URI'].

The referring page is (usually) available in $_SERVER['HTTP_REFERER'].
0
 
billium99Author Commented:
Thanks but I can't seem to get any of that to work on a post or page in the editor. Do I need to wrap this in some kind of script tag?
0
 
billium99Author Commented:
Never mind - I figured it out. Thanks for the help!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now