a newbie question!
I have set up some code to create an image with this url:
www.mywebpage.php?wc1=99&wc2=6&wc3=23
In a php page want to use the wc1, wc2 and wc3 variables from the url as inputs to a bar chart graphic
the code on the receiving webpage includes this line:
$datay=array($_REQUEST['wc1'], $_REQUEST['wc2'], $_REQUEST['wc3']);
and using the datay array I get a nice bar chart with three bars.
My problem is I want to create urls with any number of wc? variables, and then create an array with any number of bars in the resulting bar chart. The numbero f bars should be dynamically set by some other real-time process.
So I realise I need to embed this line of code:
$datay=array($_REQUEST['wc1'], $_REQUEST['wc2'], $_REQUEST['wc3']);
in a loop and add in variablles to the array one by one until they are all added (whatever number there are).
However, I am stuck at the first hurdle as I do not know how to add a variable to the array.
This code does not work:
$firstBit = $_REQUEST['wc1'];
$datay=array(firstBit, $_REQUEST['wc2'], $_REQUEST['wc3']);