TCPDF ERROR: Can't open image file: http://xyz.com/images/i270.png

Ro Ron 21 Mar, 2020
I have a form that generates a PDF that is saved in a folder. After I upgraded to php 7.3 I get an error " TCPDF ERROR: Can't open image file: http://xyz.com/images/i270.png".
I am not able to figure out what could be the mistake.
I have a lot of php coding in my form and it confuses me to use v6 so I am sticking on to V5 which I find more durable.
Please help
​
Thanks
​
Ron
he healyhatman 22 Mar, 2020
And do you HAVE such an image at that url on your site? Can you access it in a browser?
Ro Ron 23 Mar, 2020
Hello,
​
Yes.. It works fine upto php 7.0. but after that I get this error.
Ro Ron 25 Mar, 2020
Hello
I have this code that picks up the image from a dynamic file. Works fine till php 7. after that i get an error as above.
​
<?php echo "\n         {$image[$form->data['photo']]}"; ?>
And if I uncomment it the entire form works fine like this:
​
<?php // echo "\n         {$image[$form->data['photo']]}"; ?>
​
Thanks
​
Ron
Gr GreyHead 25 Mar, 2020
Hi Ronn,
​
PHP 7 has limited the ways in which arrays can be defined - please try defining $image as an array before you use it here.
​
Bob
Ro Ron 25 Mar, 2020
Hey Bob
​
Thanks for the reply.. I am not able to get it work..
<?php  
$unit = $image[$form->data['photo']];

echo $unit

?>
​
Could you suggest an example please..
​
Thanks again
​
Ron
Gr GreyHead 26 Mar, 2020
Hi Ron,
​
Where do you define $image - it's not part of the normal form data?
​
Bob
Ro Ron 26 Mar, 2020
Hello Bob
​
It is from my array
​
<?php. $image = array(	); ?>
​
Random pick
​
Ronn
Gr GreyHead 27 Mar, 2020
Hi Ronn,
​
But that isn't in the code snippet in your earlier post?? I'm not sure what you are trying to do here?
​
Bob
Ro Ron 27 Mar, 2020
Bob.
​
The. earlier snippet is the code I use to pick data from my array (the second snippet). You asked me where the $image came from .. I have been using this code till php 7.0 but after 7.0 if I choose 7.1 or 7.2 or 7.3 php this does not work.
​
Hope I have been able to rightly mention.
​
Thanks
​
Ron
Gr GreyHead 28 Mar, 2020
Hi Ron,
​
I'm sorry but I don't see how this works - have you only posted a part of your PHP code here?
​
Bob
This topic is locked and no more replies can be posted.