passing PHP variables across javascript windows.open to another PHP page

前端 未结 1 534
执笔经年
执笔经年 2021-01-28 15:26

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

相关标签:
1条回答
  • 2021-01-28 16:04

    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>"
    
    0 讨论(0)
提交回复
热议问题