Jump to content

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/74281-sessions/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/74281-sessions/#findComment-375361
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.