hfarrah Posted October 17, 2006 Share Posted October 17, 2006 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 Link to comment https://forums.phpfreaks.com/topic/24267-how-to-pass-data-through-an-img-src-call-to-an-image-generating-php-script/ Share on other sites More sharing options...
rab Posted October 17, 2006 Share Posted October 17, 2006 <img src="chart.php?type=stats" />Then have a PHP file parse $_GET['type'], generate image with GD and post headers respectively Link to comment https://forums.phpfreaks.com/topic/24267-how-to-pass-data-through-an-img-src-call-to-an-image-generating-php-script/#findComment-110280 Share on other sites More sharing options...
printf Posted October 17, 2006 Share Posted October 17, 2006 // image tag[code]<img src='/script.php?data=<?=urlencode ( serialize ( $array ) );?>' alt='' />[/code]// script.php[code]$data = unserialize ( $_GET['data'] ); // but validate $_GET['data'] first (isset, ...)[/code]me! Link to comment https://forums.phpfreaks.com/topic/24267-how-to-pass-data-through-an-img-src-call-to-an-image-generating-php-script/#findComment-110281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.