Hi,
I wish to pass multiple parameters to an img src. I already have successfully passed the one parameter using the following code:
<img src="Chart.php?graphdata1=<?php echo $datacolumns1 ?>">
can anyone tell me what the syntax would be to pass a second parameter? eg if I wished to pass $datacolumns2 as graphdata2, maybe something like (although this doesn't work)....
<img src="Chart.php?graphdata1=<?php echo $datacolumns1 graphdata2=<?php echo $datacolumns2 ?>">
Many thanks
Passing Multiple Parameters to an img src
Moderator: General Moderators
Re: Passing Multiple Parameters to an img src
You were very close. If you are using the GET method, which I assume you are by your code, you need "&" between all of your variables. The following code should work correctly.
Code: Select all
<img src="Chart.php?graphdata1=<?php echo $datacolumns1; ?>&graphdata2=<?php echo $datacolumns2; ?>">Re: Passing Multiple Parameters to an img src
Many thanks for this - it works!