D
D
Dmitry2022-04-01 14:00:57
PHP
Dmitry, 2022-04-01 14:00:57

How to pass data to fancybox modal window?

Good day! Please tell the ignorant one =(((

There is a page for example index.php in it some big code and all sorts of variables are all displayed on the page as it should and put a button button on the page which pulls up the questionnaire template through fancybox.

$good['name'];
$good['id'];
<div class="actions">
     <button class="actions-primary-button" type="button" data-fancybox data-type="ajax" 
                      data-src="/box.php">Оставить отзыв</button>
</div>

here in this box.php template, if I try to display $good['id'] for example, then nothing happens, NULL comes. although this variable is on the page index.php ie. Can you please tell me how to get these variables in the modal window?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2022-04-01
@ThunderCat

although this variable is on the page index.php ie.
Although it is not on the box.php page. And the box.php page doesn't know what happened in index.php.
Now the task with an asterisk: we need to think about how data is transferred from one page to another if the page is loaded by url...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question