如何用PHP打开一个新选项卡

Tim*_*ime -2 html javascript php image new-window

我正在尝试用Php打开一个新选项卡,然后显示一个图像.我找到了openWindow()函数,但它适用于Javascript.我只想使用Php.

我的Php代码:

<?php
function showImage() {
  $my_img = imagecreate( 200, 80 );
  $background = imagecolorallocate( $my_img, 0, 0, 255 );
  $text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
  $line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
  imagestring( $my_img, 4, 30, 25, "Quote", $text_colour );
  imagesetthickness ( $my_img, 5 );
  imageline( $my_img, 30, 45, 165, 45, $line_colour );

  header( "Content-type: image/png" );
  imagepng( $my_img, "quote.png" );
  imagecolordeallocate( $line_color );
  imagecolordeallocate( $text_color );
  imagecolordeallocate( $background );
}
?>
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激!

Joc*_*cke 5

PHP是一种服务器端语言.这使得无法在不使用Javascript的情况下在用户的webclient中打开新选项卡.

以下是更多信息:使用JavaScript在新选项卡(而不是新窗口)中打开URL