sandy1028 Posted October 22, 2007 Share Posted October 22, 2007 echo "<div style=\"position:absolute; left:100; top:468;\"><img src=\"radar.php?v1=$val[0]&v2=$val[1]&v3=$val[2]&v4=$val[3]&v5=$val[4]&v6=$val[5]&v7=$val[6]&v8=$val[7]\" border=0 usemap=\"#radar\"></div>"; session_start(); $xpoint = explode("%",$_SESSION["cx"]); session_destroy(); $val = RadarGraph($dbyesdate); array_shift($val); echo "<div style=\"position:absolute; left:642; top:468;\"><img src=\"radar.php?v1=$val[0]&v2=$val[1]&v3=$val[2]&v4=$val[3]&v5=$val[4]&v6=$val[5]&v7=$val[6]&v8=$val[7]\" border =0 usemap=\"#radar\"></div>"; session_start(); $xpoint = explode("%",$_SESSION["cx"]); session_destroy(); echo "<map name=\"radar\">"; echo "<area shape=\"circle\" coords=\"$xpoint[0],4\" href=\"#\" title=\"N - $val[1]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[1],4\" href=\"#\" title=\"C - $val[2]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[2],4\" href=\"#\" title=\"M - $val[3]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[3],4\" href=\"#\" title=\"N - $val[4]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[4],4\" href=\"#\" title=\"R - $val[5]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[5],4\" href=\"#\" title=\"A - $val[6]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[6],4\" href=\"#\" title=\"G - $val[7]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[7],4\" href=\"#\" title=\"B - $val[0]\">"; echo "</map>"; i am not able to start the two sessions. The mouse pointer points to the second graph same as the first graph. Quote Link to comment https://forums.phpfreaks.com/topic/74281-sessions/ Share on other sites More sharing options...
corillo181 Posted October 22, 2007 Share Posted October 22, 2007 session_start can not come after anything. Quote Link to comment https://forums.phpfreaks.com/topic/74281-sessions/#findComment-375299 Share on other sites More sharing options...
sandy1028 Posted October 22, 2007 Author Share Posted October 22, 2007 session_start can not come after anything. Please could you explain in detail. How can I use xpoint for two graphs.. The values are different Quote Link to comment https://forums.phpfreaks.com/topic/74281-sessions/#findComment-375332 Share on other sites More sharing options...
kenrbnsn Posted October 22, 2007 Share Posted October 22, 2007 You can only have one $_SESSION per script. The session_start() MUST* come before any output is sent to the screen. If you want to reference two session variables that have different values but the same name, you can either make them an array or give them two different names in the session. In your case, I would make the variable into an array: <?php session_start(); echo "<div style=\"position:absolute; left:100; top:468;\"><img src=\"radar.php?v1=$val[0]&v2=$val[1]&v3=$val[2]&v4=$val[3]&v5=$val[4]&v6=$val[5]&v7=$val[6]&v8=$val[7]\" border=0 usemap=\"#radar\"></div>"; $xpoint = explode("%",$_SESSION["cx"][0]); $val = RadarGraph($dbyesdate); array_shift($val); echo "<div style=\"position:absolute; left:642; top:468;\"><img src=\"radar.php?v1=$val[0]&v2=$val[1]&v3=$val[2]&v4=$val[3]&v5=$val[4]&v6=$val[5]&v7=$val[6]&v8=$val[7]\" border =0 usemap=\"#radar\"></div>"; $xpoint = explode("%",$_SESSION["cx"][1]); echo "<map name=\"radar\">"; echo "<area shape=\"circle\" coords=\"$xpoint[0],4\" href=\"#\" title=\"N - $val[1]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[1],4\" href=\"#\" title=\"C - $val[2]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[2],4\" href=\"#\" title=\"M - $val[3]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[3],4\" href=\"#\" title=\"N - $val[4]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[4],4\" href=\"#\" title=\"R - $val[5]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[5],4\" href=\"#\" title=\"A - $val[6]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[6],4\" href=\"#\" title=\"G - $val[7]\">"; echo "<area shape=\"circle\" coords=\"$xpoint[7],4\" href=\"#\" title=\"B - $val[0]\">"; echo "</map>"; ?> Of course, you will have to store them the same way. * If you defer output, the session_start() doesn't have to come before any other output, but I find that confusing. Ken Quote Link to comment https://forums.phpfreaks.com/topic/74281-sessions/#findComment-375361 Share on other sites More sharing options...
sandy1028 Posted October 23, 2007 Author Share Posted October 23, 2007 I am not able to get the exact point of xpoint for any graph... Is there any possible way from where I can add two sessions and with $_SESSION["cx"] Quote Link to comment https://forums.phpfreaks.com/topic/74281-sessions/#findComment-375971 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.