Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
两页之间的php会话_Php_Session - Fatal编程技术网

两页之间的php会话

两页之间的php会话,php,session,Php,Session,我的目标是在用户单击play thelocation_id时打开一个新的会话(有一个用户会话的登录系统),然后他被重定向到下一页,并在那里从数据库中选择数据。 当打印\u r会话时,我得到位置\u id的空会话(用户会话正常!) 在这里,用户选择一个点 $location_id = $_GET['location_id']; echo $location_id; var i ; var confirmed = 0; for (i = 0; i < lo

我的目标是在用户单击play the
location_id
时打开一个新的会话(有一个用户会话的登录系统),然后他被重定向到下一页,并在那里从数据库中选择数据。 当
打印\u r
会话时,我得到
位置\u id
的空会话(用户会话正常!)

在这里,用户选择一个点

$location_id = $_GET['location_id'];

echo $location_id;


        var i ; var confirmed = 0;
        for (i = 0; i < locations.length; i++) {
            marker = new google.maps.Marker({
                position: new google.maps.LatLng(locations[i][1], locations[i][2]),
                map: map,
                icon :   locations[i][4] === '1' ?  red_icon  : purple_icon,
                html: "<div id='window_loc'>\n" +
                "<form method='POST' action='question.php'>\n" +
                "<table class=\"map1\">\n" +
                "<tr>\n" +
                "<td><input type='hidden'  id='manual_description'/>"+locations[i][3]+"</td></tr>\n" +
                "<tr>\n" +
                "<td><textarea disabled  id='question' placeholder='Question'>"+locations[i][5]+"</textarea></td></tr>\n" +
                "<tr>\n" +
                "<td><input type='hidden' name='location_id' id='location_id' value="+locations[i][0]+" /></td></tr>\n" +
                "<td><input id='button1' name='play' type='submit' value='play'/> </td></tr>\n" +
                "</table>\n" +
                "</form>\n" +
                "</div>"
            });


            google.maps.event.addListener(marker, 'click', (function(marker, i) {
                return function() {
                    infowindow = new google.maps.InfoWindow();
                    confirmed =  locations[i][4] === '1' ?  'checked'  :  0;
                    $("#confirmed").prop(confirmed,locations[i][4]);
                    $("#location_id").val(locations[i][0]);
                    $("#description").val(locations[i][3]);
                    $("#form").show();
                    infowindow.setContent(marker.html);
                    infowindow.open(map, marker);
                }
            })(marker, i));
        }




也许这会有帮助:


  • 您正在使用
    $location\u id=$\u GET['location\u id']
    (GET方法),但在JS中,您创建了一个带有
    的表单,我已将操作更改为GET,并使用secses tnx!!
    
    $location_id = $_GET['location_id'];
    
    echo $location_id;