I have a PHP page index.php
contains javascript window.open code to make another page create_pdf.php
popup and pass some PHP variables to it to create
Not sure I am following but you might want to try:
$pdf_link = "<div class=\"pdf-box\"><a target=\"_blank\"
onclick=\"return !window.open(this.href, 'pdf', 'width=640,height=300')\"
href=\"http://mysite.com/create_pdf.php?text1=" . urlencode($text1) . "&text2=" . urlencode($text2) . "\";
return false;\">Create pdf</a></div>";
or
$fullLinkWithParams = urlencode("http://mysite.com/create_pdf.php?text1=" . $text1 . "&text2=" . $text2);
$pdf_link = "<div class=\"pdf-box\"><a target=\"_blank\"
onclick=\"return !window.open('" . $fullLinkWithParams . "', 'pdf', 'width=640,height=300')\">Create pdf</a></div>"