I am trying to set the following image as a variable.
I get this error when accessing the pdf: FPDF error: Image file has no extension and no type was specified:
Here is my code:
$image1 = "../storage/$_GET[id]/01.jpg";
function Header()
{
$this->Image($image1,10,8,33);
}
anything wrong in it?
If the code you posted it’s your actual code, try:
Please read here;
Anyway, if
$_GET['id']must be a integer value, it’s better to avoid security issues using:Read here and here.
Also, as dev-null-dweller said, global variables aren’t visible inside functions. In that case, fix it using:
And have a look here.