Ok this is what I have so far. I'm using it with jpgraph:
This is my receiving page from the form. Only included the first if statement here
$players = $_POST['subcat3'];
$position = $_POST['cat'];
$year = $_POST['subcat'];
$fpydpt = $_POST['pass_yd'];
$fpydper = $_POST['pass_ydper'];
$fruydper = $_POST['rush_ydper'];
$freydper = $_POST['rec_ydper'];
$fptd = $_POST['pass_td'];
$fruyd = $_POST['rush_yd'];
$freyd = $_POST['rec_yd'];
$fttd = $_POST['total_td'];
$fin = $_POST['qbin'];
$freatt = $_POST['rec_att'];
$fpydcalc = ($fpydpt / $fpydper);
$fruydcalc = ($fruyd / $fruydper);
$freydcalc = ($freyd / $freydper);
if (($_POST['pass_yd'] > 5) || ($_POST['pass_ydper'] > 50) || ($_POST['rush_yd'] > 3) || ($_POST['rush_ydper'] > 50) || ($_POST['rec_yd'] > 3) || ($_POST['rec_ydper'] > 50) || ($_POST['qbin'] < -5) || ($_POST['qbin'] > 0) || ($_POST['rec_att'] > 3) || ($_POST['pass_td'] > 10) || ($_POST['total_td'] > 10))
{
echo "<B>Give me a break. Pick some real settings. <a href=\"graphmenu.php\">Try again</a></b><br><br>";
}
elseif (isset($_POST['subcat3']) && (isset($_POST['subcat'])) && (isset($_POST['ret'])))
{
if ($_POST['cat']== 1)
{
$SQL = "SELECT * from playerstats ps, players p WHERE ps.player_id='".$_POST['subcat3']."'". " and p.player_id=ps.player_id and ps.year='".$_POST['subcat']."'". " ORDER BY ps.week ASC";
$RESULT = mysql_query($SQL);
if ($myrow=mysql_fetch_array($RESULT)) {
do {
$year = $myrow["year"];
$ptd[] = $myrow["pass_td"];
$ryd[] = $myrow["rush_yd"];
$datawk[] = $myrow["week"];
$qbi[] = $myrow["qb_in"];
$data[] = $myrow["pass_yd"];
$att[] = $myrow["pass_att"];
$cmp[] = $myrow["pass_cmp"];
$data2[] = (($myrow['pass_yd'] * $fpydcalc) + ($myrow['pass_td'] * $fptd) + ($myrow['qb_in'] * $fin) + ($myrow['rush_yd'] * $fruydcalc) + ($myrow['total_td'] * $fttd));
$lastname = $myrow["lname"];
$firstname = $myrow["fname"];
$data_names[] = $myrow["lname"]."(".$players.")";
}
while ($myrow=mysql_fetch_array($RESULT));
}
for ($n = 0; $n < max($datawk); $n++) {
if ($datawk[$n] != $n + 1) {
array_splice($datawk, $n, 0, (array) '-');
array_splice($data, $n, 0, (array) '0');
array_splice($ptd, $n, 0, (array) '0');
array_splice($data2, $n, 0, (array) '0');
}
}
$sdatawk = urlencode(serialize($datawk));
$sdata2 = urlencode(serialize($data2));
$sdata = urlencode(serialize($data));
$scmp = urlencode(serialize($cmp));
$satt = urlencode(serialize($att));
$sqbi = urlencode(serialize($qbi));
$sryd = urlencode(serialize($ryd));
$sptd = urlencode(serialize($ptd));
echo "<img src=\"graphcode.php?pid=$players&pos=$position&year=$year&pypt=$fpydpt&pydp=$fpydper&datay=$sdata&datawk=$sdatawk&data2=$sdata2&ptd=$sptd&qbi=$sqbi&ryd=$sryd&cmp=$scmp&att=$satt&lname=$lastname&fname=$firstname&rydp=$fruydper&fruydp=$fruyd\">";
}
Im trying to pass the arrays to the graphcode page, which does the actual graph rendering.
That page looks like this:
I've removed the actual graph code for sake of space, but it does work:
$players = $_GET['pid'];
$position = $_GET['pos'];
$year = $_GET['year'];
$tdatawk= urldecode(unserialize($_GET['datawk']));
$tdata = urldecode(unserialize($_GET['datay']));
$tdatay2 = urldecode(unserialize($_GET['datay2']));
$tdata2 = urldecode(unserialize($_GET['data2']));
$tqbi = urldecode(unserialize($_GET['qbi']));
$tptd = urldecode(unserialize($_GET['ptd']));
$tatt = urldecode(unserialize($_GET['att']));
$tcmp = urldecode(unserialize($_GET['cmp']));
$tryd = urldecode(unserialize($_GET['ryd']));
$fpydpt = $_GET['pypt'];
$fpydper = $_GET['pydp'];
$fruydper = $_GET['rydp'];
var_dump ($tdatawk);