[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Send current WordPress page in a URL parameter

Posted on 2016-10-28
3
Medium Priority
?
138 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 111

Accepted Solution

by:
Ray Paseur earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

831 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