Jump to content


Photo

How to pass data through an img src call to an image generating php script??


  • Please log in to reply
2 replies to this topic

#1 hfarrah

hfarrah
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 17 October 2006 - 09:21 PM

I am trying to call a chart generator php program through an img src statement and to specify an argument.  Can someone help with syntax?

The base call is <img src="chart.php> and I would like to send an array if possible.

Tjhanks,
Anthony

#2 rab

rab
  • Members
  • PipPipPip
  • Advanced Member
  • 155 posts

Posted 17 October 2006 - 09:42 PM

<img src="chart.php?type=stats" />

Then have a PHP file parse $_GET['type'], generate image with GD and post headers respectively

#3 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 17 October 2006 - 09:43 PM

// image tag

<img src='/script.php?data=<?=urlencode ( serialize ( $array ) );?>' alt='' />

// script.php

$data = unserialize ( $_GET['data'] ); // but validate $_GET['data'] first (isset, ...)


me!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users