我能把下面的$_get变量放入fpdf 吗
//User Details
$Name = $_GET['name'];
$Surname = $_GET['surname'];
$City = $_GET['city'];
$CountryCode = $_GET['countrycode'];
$Phone = $_GET['phone'];
$Email = $_GET['email'];
<?php
include('includes/fpdf.php');
$Name = $_GET['name'];
$Surname = $_GET['surname'];
$City = $_GET['city'];
$CountryCode = $_GET['countrycode'];
$Phone = $_GET['phone'];
$Email = $_GET['email'];
class PDF extends FPDF
{
// Page header
function Header()
{
我需要在提交表单后创建一个pdf文件,并让用户打印该文件。
我对fpdf一点都不熟悉,但在类方法中,你会做一些类似的事情
$pdf = new PDF();
$pdf->someMethod($Name);
它会将$Name变量传递到该方法
include('includes/fpdf.php');
public $Name = "";
class PDF extends FPDF
{
function XYZ()
{
$this->Name = $_GET["name"];
}
}
This is the way of receiving the data in a class. But its more better if
you read the fpdf documentation, in which you can get more information
about generating the pdf.
FPDF API似乎是一个完整的函数和特性库。
在这里编写如何使用所有功能会浪费时间,所以请在其他地方找到FPDF的文档。
这是我发现的第一个似乎富有成效的链接:
- 用PHP和FPDF生成PDF文件