Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How to get current URL
I have Txp that generates an HTML form:
<form method="POST" action='/tools/<txp:article_url_title />'>
[...snip...]
When I use the preview links from the admin panel, the URL is:
https://<site>/textpattern/index.php?txpreview=<number>
So, my Txp generates the wrong URL when previewed. How do I get the current URL in Txp?
Offline
Re: How to get current URL
Just to answer my own question for posterity:
<form method="POST" action='<txp:page_url />'>
Offline
Re: How to get current URL
You can leave out action
if you intend to process the form on the URL in which the form is located. So this is fine:
<form method="POST">
Offline
Re: How to get current URL
So, it does! If there was a reason why I wrote the form that way ten years, then it’s been lost to the mists of time.
Offline
Pages: 1