Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying Image_Graph to accept an array or $_POST data instead of $_GET data.

Status
Not open for further replies.

beakerboy

Technical User
May 31, 2001
27
US
I'm using a package called Image_Graph to produce some scatter plots on the fly in a website. The way this file works is, it accepts values as $_GET parameters and produces a png image. You call it with <img src="Image_Graph?title=foo&x0=1&y0=0....">

It works great, but I have so much data that the URL is too long and apache rejects the connection. I need to either modify it so it accepts $_POST data, or change it from a file to a function which will accept an array of data. I've messed around with the second option and can't get it to display an image, the process of "creating an image file" is modifying headers which have already been set by the HTML file.
Code:
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\PezBase\barrel.php:37) in C:\Program Files\PHP\zip\PEAR\Image\Canvas\GD\PNG.php on line 105
�PNG  IHDR����IDATx���{l������PZ.�_ei'�C'�P�Y c������Te�ad5�?��ln,q�1�?�Y��,�,�T���J�ʔ��Q�Į���gv-����ҽ^!�9�yη����s��l6�@?�� pZ�"�a*�����>����~&��/���x��W�_��˛��3gά��lhh�]�w��E�>|�w���#�<2s��آ���°�$ɺu�Z[[<���Ξ=�s�9r�Ho��㯽��3f��f�G��1c���_ߗksc�y�}�[׃{�OUUUEEEk+W�,..���ի;~�w�$���:o{�g���Ħ���?�6mڴiӦ$IF��t�����q������c~��篸��ƍw饗���˵'��|jkk���?v�خ;G�����g�ٹ�;��裏r�n�z�e� �'`����ʕ+׬YSPP0s��?S���'M��uϔ)S:��{�v0|�ᇕ��?�я�rp^^^׋MMMӦM�y����3f\x�}�2eJ_��&M5jT����g����2�S����sF�%K����~�駹
Should I look into using cURL to change the file to use POST?

I ~could~ create a form with all the POST data embedded within it and ask the user to click a submit button to be taken to the image of the data, but this is definitely not ideal.

This is probably a long shot if you've never looked at the source code, but do you have any advice on the best strategy to do this?

Thanks,
Kevin
 
i'm sure it's possible. more likely with a session key as a form will not be delivered simply by a page load.

why not post the code you are using so we can take a look whether there is an alternative solution.
 
Using using session data is a great idea! Thanks.

Kevin
 
I moved the get references to session and it works perfectly! Much easier than I was thinking before your suggestion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top