问题描述
当我尝试在PDF中显示链接时,它不会向我显示链接,但是显示了PHP代码或字符串文本.我该如何更改?
这是我的代码
while($fila2 = mysql_fetch_array($fila)) { $item = $item+1; $pdf->Cell(5, 8 ,$item, 1); $pdf->Cell(10, 8 ,$fila2['FOLIO'], 1); $pdf->Cell(70, 8 ,$fila2['NOMBRE'], 1); $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_SOLICITUD'])), 1); $pdf->Cell(25, 8 ,$fila2['TIPO_AUTORIZACION'], 1); $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_AUTORIZACION'])), 1); $pdf->Cell(20,8 , '<a href="http://www.intranet.com/mb/rprh06/final.php?folio=$fila2["FOLIO"]" target="_blank">Enlace</a>',1); $pdf->Ln(8); }
,这是我的结果
我想根据该行的结果ID显示"视图链接"之类的内容.但是当我通过链接上的指针时,它显示以下
谢谢.
推荐答案
基于链接: - http://www.fppdf.org/en/doc/link.htm
您需要这样写: -
$pdf->Link(100,10,10,10, 'http://www.intranet.com/mb/rprh06/final.php?folio='.$fila2["FOLIO"]);
或Cell(): -
$pdf->Cell(20,8 ,'','','','',false, "http://www.intranet.com/mb/rprh06/final.php?folio=".$fila2["FOLIO"]);
参考: - http://www.fpdf.org/en/en/en/doc/cell .htm
注意: - 相应地更改参数值.
问题描述
When I try to display a link in pdf it does not show me the link, but the php code or string text are displayed. How can I change that?
This is my code
while($fila2 = mysql_fetch_array($fila)) { $item = $item+1; $pdf->Cell(5, 8 ,$item, 1); $pdf->Cell(10, 8 ,$fila2['FOLIO'], 1); $pdf->Cell(70, 8 ,$fila2['NOMBRE'], 1); $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_SOLICITUD'])), 1); $pdf->Cell(25, 8 ,$fila2['TIPO_AUTORIZACION'], 1); $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_AUTORIZACION'])), 1); $pdf->Cell(20,8 , '<a href="http://www.intranet.com/mb/rprh06/final.php?folio=$fila2["FOLIO"]" target="_blank">Enlace</a>',1); $pdf->Ln(8); }
And this is my result
I want to show something like "View Link" according to the result ID of the row. But when I pass the pointer on the link it shows the following
Thank You.
推荐答案
Based on the link:- http://www.fpdf.org/en/doc/link.htm
You need to write like this:-
$pdf->Link(100,10,10,10, 'http://www.intranet.com/mb/rprh06/final.php?folio='.$fila2["FOLIO"]);
Or with Cell():-
$pdf->Cell(20,8 ,'','','','',false, "http://www.intranet.com/mb/rprh06/final.php?folio=".$fila2["FOLIO"]);
Reference:- http://www.fpdf.org/en/doc/cell.htm
Note:- change parameters values accordingly.