Answer the question
In order to leave comments, you need to log in
How to pass data with post method between Wordpress pages?
I don’t understand how to send data between wordpress pages (created through the admin panel).
on the page site.ru/page1 there is a form that sends data to the page site.ru/page2. but the variables do not reach the second page
<form class="topbutton" method="post" action="/page2">
<input type="hidden" name="gorod" value="название города" />
<input class="submit" type="submit" name="submit" value="Заказать сейчас" />
</form>
<?php if (!empty($_POST["gorod"]))
{
echo $_POST["gorod"];
}
else
{
echo "Переменная не дошли";
} ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question