[SOLVED] GD Printing issue...
Posted: Mon Apr 17, 2006 5:15 pm
Hello,
I'm new to PHP and GD, but have done a lot of graphics programming. I have a HTML FORM that when SUBMITTED invokes a PHP script that uses GD calls. I use POST to pass data, such as first_name, last_name, as well as numerous radio_button_values.... This PHP-GD script will then process and correctly display as I programmed it to within the browser, but when I try to print this browser display, the final output paper version is incorrect. Specifically, the data which originated or was defined by the end user in the FORM (for example first_name) does not appear on the final paper output. These data values are being correctly displayed within the browser, created using PHP GD calls such as "imagestring". For example if in the FORM I set first_name = "Terry", the PHP-GD script will make a call to "imagestring" to correctly display "Terry" within the browser, but when I then use the print feature of the browser, the contents of first_name will print as "". I had a suspicion that this was related to the scope of the data variables, but doing further debugging I removed all the GD calls and replaced the text display calls with simple PHP "echo" calls. This debug approach worked correctly within both the browser version as well as on the final printed version. My goal is to create a display that is a combination of both text and graphics, so I need to use GD calls, hence simple "echo" calls won't meet my overall needs. Something I noticed is that this is happening only to the data values that originated in the FORM and which are obtained via a $_POST call from within the PHP-GD script. It is as if the data that gets sent to the printer is simply the PHP-GD script without the ability to get at the user-defined FORM data. Any idea how to resolve this?
TIA
-T
I'm new to PHP and GD, but have done a lot of graphics programming. I have a HTML FORM that when SUBMITTED invokes a PHP script that uses GD calls. I use POST to pass data, such as first_name, last_name, as well as numerous radio_button_values.... This PHP-GD script will then process and correctly display as I programmed it to within the browser, but when I try to print this browser display, the final output paper version is incorrect. Specifically, the data which originated or was defined by the end user in the FORM (for example first_name) does not appear on the final paper output. These data values are being correctly displayed within the browser, created using PHP GD calls such as "imagestring". For example if in the FORM I set first_name = "Terry", the PHP-GD script will make a call to "imagestring" to correctly display "Terry" within the browser, but when I then use the print feature of the browser, the contents of first_name will print as "". I had a suspicion that this was related to the scope of the data variables, but doing further debugging I removed all the GD calls and replaced the text display calls with simple PHP "echo" calls. This debug approach worked correctly within both the browser version as well as on the final printed version. My goal is to create a display that is a combination of both text and graphics, so I need to use GD calls, hence simple "echo" calls won't meet my overall needs. Something I noticed is that this is happening only to the data values that originated in the FORM and which are obtained via a $_POST call from within the PHP-GD script. It is as if the data that gets sent to the printer is simply the PHP-GD script without the ability to get at the user-defined FORM data. Any idea how to resolve this?
TIA
-T