简体   繁体   English

执行某些操作后如何执行包含的文件

[英]How to execute the included file after performing some action

I have one html file called "usera_authentication.html" in which i am entering 3 text field's data. 我有一个名为“ usera_authentication.html”的html文件,我在其中输入3个文本字段的数据。 On sumit button it is redirecting to "usera.php". 在sumit按钮上,它重定向到“ usera.php”。 usera.php have below code. usera.php具有以下代码。

<body>
    <div class="container">
        <div class="pane" id="pane_0">
            <img src="video_logo.png">
        </div>
        <div class="pane" id="pane_1" style="display: none">
            <input type="button" value="Call Customer Care" id="call" class="btn btn-info btn-default btn-block">
        </div>
        <div class="pane" id="pane_2" style="display: none">
            <div id="video_container"></div>
            <input type="button" value="Stop Call" id="quit" class="btn btn-danger btn-default btn-block">
        </div>
    </div>
    <script>
        var userid="<?php echo isset($_POST['userid'])?$_POST['userid']:'';?>";
        var userName="<?php echo isset($_POST['userName'])?$_POST['userName']:'';?>";
        var remoteUserId="<?php echo isset($_POST['remoteUserId'])?$_POST['remoteUserId']:'';?>";

    </script>
    <?php if(isset($_POST['userid']) && $_POST['userid']!=""){ echo "in"; ?>
    <script type="text/javascript" src="conference.js"></script>
    <script type="text/javascript" src="https://api.bistri.com/bistri.conference.min.js"></script>
    <?php } ?>
</body>

I am getting data in $_POST and it is initialize in variables perfectly. 我在$ _POST中获取数据,并且已在变量中完美初始化。 Now those variables "userid,userName,remoteUserId" are used in conference.js file and using those variable connection process happening. 现在,这些变量“ userid,userName,remoteUserId”已在Conference.js文件中使用,并且正在使用发生这些变量的连接过程。

Now my issue is connection.js file is executing before the variable initialized from $_POST and due to that i am not getting correct value in connection.js file and connection not happening. 现在我的问题是在从$ _POST初始化变量之前,正在执行connection.js文件,由于我在connection.js文件中没有获得正确的值并且连接没有发生。

Does anybody have any idea how to resolve my above issue? 有人知道如何解决我的上述问题吗?

Overall my purpose is pass the data from usera_authentication.html file and use those data in connection.js file which is included in usera.php. 总的来说,我的目的是传递usera_authentication.html文件中的数据,并在usera.php中包含的connection.js文件中使用这些数据。 I can not directly pass to connection.js file because it is global file which will also use from userb.php file same as usera.php. 我不能直接传递给connection.js文件,因为它是全局文件,也将从userb.php文件使用与usera.php相同的文件。

Any help will be appreciated. 任何帮助将不胜感激。

I have resolved my issue. 我已经解决了我的问题。 Actually i have made one mistake in variable name and due to that i was not able to get the correct data in js file. 实际上,我在变量名中犯了一个错误,由于我无法在js文件中获取正确的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM