Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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