Solved

Send current WordPress page in a URL parameter

Posted on 2016-10-28
3
55 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 109

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

776 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