Answer the question
In order to leave comments, you need to log in
How to pass the url value after the pound sign # in Formit?
Greetings.
The page contains a link leading to a separate form page. The form page is linked to from different pages. Form links have a common form in the template and look like this: <a href="form#">Ссылка на форму</a>
The default URL of the form is: http://site.ru/form
When you click on the link leading to the form, the URL is: The http://site.ru/form#previous_url
question is the following. How to read the last and full URL address and send it in the email when submitting the form, so that you can understand on which page the application button was clicked? Those. not only site.ru/form , but also/inclusive after the pound sign - site.ry/form#previous_url
Perhaps there are already similar solutions. Unfortunately, you don't want to make a form directly on the page because of the design of the page itself; I also don’t want to make a form in a pop-up window, especially since getting the URL address of the form from the page of which it was activated, located in another document, also causes similar difficulties.
What options are available?
I would appreciate any helpful advice or solution.
Explanation
There are pages with the following addresses:
site.ru/page1
site.ru/page2
site.ru/page3
...
site.ru/page100
site.ru/form
site.ru/form#page1
site.ru/form#page2
site.ru/form#page3
...
site.ru/form#page100
Answer the question
In order to leave comments, you need to log in
As an option - you pass the get-parameter in the link, i.e. the link will be like this <a href="form?page_id=2">Ссылка на форму</a>
Then you create a "my_id_page" snippet, like this:
<?php
$pageID = strip_tags($_GET["page_id"]);
echo $pageID;
?>
<input value="" hidden/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question