Solved

Send current WordPress page in a URL parameter

Posted on 2016-10-28
3
48 Views
Last Modified: 2016-10-29
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
Comment
Question by:billium99
  • 2
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 41864654
The current URL is (usually) available in $_SERVER['HTTP_HOST'] + $_SERVER['REQUEST_URI'].

The referring page is (usually) available in $_SERVER['HTTP_REFERER'].
0
 
LVL 1

Author Comment

by:billium99
ID: 41864826
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
 
LVL 1

Author Closing Comment

by:billium99
ID: 41865426
Never mind - I figured it out. Thanks for the help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 is …
This article discusses how to create an extensible mechanism for linked drop downs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

911 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

17 Experts available now in Live!

Get 1:1 Help Now