Hello.
There is an index.php page
echo $var1; echo $var2; echo "<a href='script.php'>Ссылка</a>"
And there is a script script. Php that uses the phpWord library
$section->addText(htmlspecialchars('Код производителя: '), 'rStyle'); $section->addText(htmlspecialchars('Цена производителя: '), 'rStyle');
And automatically forms a word-document and offers to keep it with the client. Ie I click on the link and crashes a window with a proposal to save the file.
I had a question how to transfer $var1 $var2
variables to this script so that it could save their contents into a word document? Something like this function?
function set_document(){ var link = "{$var1;}"; var value = "{$var2;}"; jQuery.ajax({ url:'script.php' , type:'POST' , data:{name:value, link:link } , success: function(response) { } }); }