Using variable on php to create another variable in JS












-1















I'm having a hard time getting the value of a specific variable in php to use in js. This is my code in php:



<?php
require("connection.php");

$sql_cmd = "SELECT * FROM tbstatus";

$stmt = $con->prepare($sql_cmd);
$stmt->execute();

echo "<h2>STATUS OF THE BABY</h2>";

while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<h4>" . $result['status'] . "</h4>";
}
?>


I want to get the value of this ($result['status']) and pass it on the variable pos in js. This is my js code:



setInterval(function() {
$("#position").load('refresh.php');
notif();

}, 1000);

function notif() {
var pos = $('PHP VARIABLE HERE').val();
alert(pos);
}


Thanks for your help.










share|improve this question

























  • Why don't you try echo for that?

    – Nico Haase
    Nov 23 '18 at 7:12






  • 1





    Possible duplicate of How to pass variables and data from PHP to JavaScript?

    – yivi
    Nov 24 '18 at 10:27
















-1















I'm having a hard time getting the value of a specific variable in php to use in js. This is my code in php:



<?php
require("connection.php");

$sql_cmd = "SELECT * FROM tbstatus";

$stmt = $con->prepare($sql_cmd);
$stmt->execute();

echo "<h2>STATUS OF THE BABY</h2>";

while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<h4>" . $result['status'] . "</h4>";
}
?>


I want to get the value of this ($result['status']) and pass it on the variable pos in js. This is my js code:



setInterval(function() {
$("#position").load('refresh.php');
notif();

}, 1000);

function notif() {
var pos = $('PHP VARIABLE HERE').val();
alert(pos);
}


Thanks for your help.










share|improve this question

























  • Why don't you try echo for that?

    – Nico Haase
    Nov 23 '18 at 7:12






  • 1





    Possible duplicate of How to pass variables and data from PHP to JavaScript?

    – yivi
    Nov 24 '18 at 10:27














-1












-1








-1








I'm having a hard time getting the value of a specific variable in php to use in js. This is my code in php:



<?php
require("connection.php");

$sql_cmd = "SELECT * FROM tbstatus";

$stmt = $con->prepare($sql_cmd);
$stmt->execute();

echo "<h2>STATUS OF THE BABY</h2>";

while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<h4>" . $result['status'] . "</h4>";
}
?>


I want to get the value of this ($result['status']) and pass it on the variable pos in js. This is my js code:



setInterval(function() {
$("#position").load('refresh.php');
notif();

}, 1000);

function notif() {
var pos = $('PHP VARIABLE HERE').val();
alert(pos);
}


Thanks for your help.










share|improve this question
















I'm having a hard time getting the value of a specific variable in php to use in js. This is my code in php:



<?php
require("connection.php");

$sql_cmd = "SELECT * FROM tbstatus";

$stmt = $con->prepare($sql_cmd);
$stmt->execute();

echo "<h2>STATUS OF THE BABY</h2>";

while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<h4>" . $result['status'] . "</h4>";
}
?>


I want to get the value of this ($result['status']) and pass it on the variable pos in js. This is my js code:



setInterval(function() {
$("#position").load('refresh.php');
notif();

}, 1000);

function notif() {
var pos = $('PHP VARIABLE HERE').val();
alert(pos);
}


Thanks for your help.







javascript php jquery database






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 6:31









Julian Stark

1,3011527




1,3011527










asked Nov 23 '18 at 5:29









Gerald ManibaleGerald Manibale

347




347













  • Why don't you try echo for that?

    – Nico Haase
    Nov 23 '18 at 7:12






  • 1





    Possible duplicate of How to pass variables and data from PHP to JavaScript?

    – yivi
    Nov 24 '18 at 10:27



















  • Why don't you try echo for that?

    – Nico Haase
    Nov 23 '18 at 7:12






  • 1





    Possible duplicate of How to pass variables and data from PHP to JavaScript?

    – yivi
    Nov 24 '18 at 10:27

















Why don't you try echo for that?

– Nico Haase
Nov 23 '18 at 7:12





Why don't you try echo for that?

– Nico Haase
Nov 23 '18 at 7:12




1




1





Possible duplicate of How to pass variables and data from PHP to JavaScript?

– yivi
Nov 24 '18 at 10:27





Possible duplicate of How to pass variables and data from PHP to JavaScript?

– yivi
Nov 24 '18 at 10:27












4 Answers
4






active

oldest

votes


















1














The easiest way is to output it to javascript directly:



?>
<script type="text/javascript">
window.MY_PHP_VAR = <?php echo json_encode($myPhpVar); ?>;
</script>
...

window.MY_PHP_VAR now contains your php variable





share|improve this answer
























  • I don't understand but thankyou

    – Gerald Manibale
    Nov 23 '18 at 6:00



















1














if your javascript code is on same page where the result is comming then you can use this



var pos =  `<?php echo $result['status'] ?>`;

var pos = `<?= $result['status'] ?>`;





share|improve this answer

































    -1














    ===============
    // refresh.php
    ===============

    <?php
    require("connection.php");
    $sql_cmd = "SELECT * FROM tbstatus";
    $stmt = $con->prepare($sql_cmd);
    $stmt->execute();

    echo "<h2>STATUS OF THE BABY</h2>";

    while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
    echo "<h4>" . $result['status'] . "</h4>";
    echo "<script> alert('". $result['status'] ."'); </script>";
    /* If the $result['status'] is 'success' the above line will be converted to:
    echo "<script> alert('success'); </script>";
    */
    }

    ?>


    so, every time the refresh.php loads, the script is going to get executed.



    However, I suggest you to assign a id or class attribute to your h4 where you are echoing your status and access the value using the selectors in the javascript.






    share|improve this answer































      -1















      1. you could try giving an id or class to the status.

      2. then in JavaScript you could then get the value of the id or class.


      PHP



      <?php
      require("connection.php");

      $sql_cmd = "SELECT * FROM tbstatus";

      $stmt = $con->prepare($sql_cmd);
      $stmt->execute();

      echo "<h2>STATUS OF THE BABY</h2>";
      while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
      echo '<h4> <span class="status">' . $result['status'] . '</span></h4>';
      }

      ?>


      JavaScript



      var oldStatus = '';

      setInterval(function() {
      $("#position").load('refresh.php');
      notif();
      }, 1000);

      function notif() {
      // note that since we used a class, you will get the value of the first element only.
      var pos = $('.status').text(); // use .text() instead of .val()
      if (pos.toLowerCase() == 'out' && pos != oldStatus){
      oldStatus = pos;
      alert(pos);
      }
      }





      share|improve this answer


























      • It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

        – Gerald Manibale
        Nov 23 '18 at 6:27











      • replace setInterval with setTimeout

        – marvinIsSacul
        Nov 23 '18 at 7:10











      • If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

        – Gerald Manibale
        Nov 23 '18 at 7:21











      • i've modified my answer. check it out.

        – marvinIsSacul
        Nov 23 '18 at 7:25











      • I don't understand this. I want it to notify me when the status is "Out".

        – Gerald Manibale
        Nov 23 '18 at 8:01











      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441073%2fusing-variable-on-php-to-create-another-variable-in-js%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      The easiest way is to output it to javascript directly:



      ?>
      <script type="text/javascript">
      window.MY_PHP_VAR = <?php echo json_encode($myPhpVar); ?>;
      </script>
      ...

      window.MY_PHP_VAR now contains your php variable





      share|improve this answer
























      • I don't understand but thankyou

        – Gerald Manibale
        Nov 23 '18 at 6:00
















      1














      The easiest way is to output it to javascript directly:



      ?>
      <script type="text/javascript">
      window.MY_PHP_VAR = <?php echo json_encode($myPhpVar); ?>;
      </script>
      ...

      window.MY_PHP_VAR now contains your php variable





      share|improve this answer
























      • I don't understand but thankyou

        – Gerald Manibale
        Nov 23 '18 at 6:00














      1












      1








      1







      The easiest way is to output it to javascript directly:



      ?>
      <script type="text/javascript">
      window.MY_PHP_VAR = <?php echo json_encode($myPhpVar); ?>;
      </script>
      ...

      window.MY_PHP_VAR now contains your php variable





      share|improve this answer













      The easiest way is to output it to javascript directly:



      ?>
      <script type="text/javascript">
      window.MY_PHP_VAR = <?php echo json_encode($myPhpVar); ?>;
      </script>
      ...

      window.MY_PHP_VAR now contains your php variable






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 23 '18 at 5:34









      FrankerZFrankerZ

      17.8k73066




      17.8k73066













      • I don't understand but thankyou

        – Gerald Manibale
        Nov 23 '18 at 6:00



















      • I don't understand but thankyou

        – Gerald Manibale
        Nov 23 '18 at 6:00

















      I don't understand but thankyou

      – Gerald Manibale
      Nov 23 '18 at 6:00





      I don't understand but thankyou

      – Gerald Manibale
      Nov 23 '18 at 6:00













      1














      if your javascript code is on same page where the result is comming then you can use this



      var pos =  `<?php echo $result['status'] ?>`;

      var pos = `<?= $result['status'] ?>`;





      share|improve this answer






























        1














        if your javascript code is on same page where the result is comming then you can use this



        var pos =  `<?php echo $result['status'] ?>`;

        var pos = `<?= $result['status'] ?>`;





        share|improve this answer




























          1












          1








          1







          if your javascript code is on same page where the result is comming then you can use this



          var pos =  `<?php echo $result['status'] ?>`;

          var pos = `<?= $result['status'] ?>`;





          share|improve this answer















          if your javascript code is on same page where the result is comming then you can use this



          var pos =  `<?php echo $result['status'] ?>`;

          var pos = `<?= $result['status'] ?>`;






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 25 '18 at 18:28









          FrankerZ

          17.8k73066




          17.8k73066










          answered Nov 23 '18 at 6:19









          AkhileshAkhilesh

          626




          626























              -1














              ===============
              // refresh.php
              ===============

              <?php
              require("connection.php");
              $sql_cmd = "SELECT * FROM tbstatus";
              $stmt = $con->prepare($sql_cmd);
              $stmt->execute();

              echo "<h2>STATUS OF THE BABY</h2>";

              while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
              echo "<h4>" . $result['status'] . "</h4>";
              echo "<script> alert('". $result['status'] ."'); </script>";
              /* If the $result['status'] is 'success' the above line will be converted to:
              echo "<script> alert('success'); </script>";
              */
              }

              ?>


              so, every time the refresh.php loads, the script is going to get executed.



              However, I suggest you to assign a id or class attribute to your h4 where you are echoing your status and access the value using the selectors in the javascript.






              share|improve this answer




























                -1














                ===============
                // refresh.php
                ===============

                <?php
                require("connection.php");
                $sql_cmd = "SELECT * FROM tbstatus";
                $stmt = $con->prepare($sql_cmd);
                $stmt->execute();

                echo "<h2>STATUS OF THE BABY</h2>";

                while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                echo "<h4>" . $result['status'] . "</h4>";
                echo "<script> alert('". $result['status'] ."'); </script>";
                /* If the $result['status'] is 'success' the above line will be converted to:
                echo "<script> alert('success'); </script>";
                */
                }

                ?>


                so, every time the refresh.php loads, the script is going to get executed.



                However, I suggest you to assign a id or class attribute to your h4 where you are echoing your status and access the value using the selectors in the javascript.






                share|improve this answer


























                  -1












                  -1








                  -1







                  ===============
                  // refresh.php
                  ===============

                  <?php
                  require("connection.php");
                  $sql_cmd = "SELECT * FROM tbstatus";
                  $stmt = $con->prepare($sql_cmd);
                  $stmt->execute();

                  echo "<h2>STATUS OF THE BABY</h2>";

                  while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                  echo "<h4>" . $result['status'] . "</h4>";
                  echo "<script> alert('". $result['status'] ."'); </script>";
                  /* If the $result['status'] is 'success' the above line will be converted to:
                  echo "<script> alert('success'); </script>";
                  */
                  }

                  ?>


                  so, every time the refresh.php loads, the script is going to get executed.



                  However, I suggest you to assign a id or class attribute to your h4 where you are echoing your status and access the value using the selectors in the javascript.






                  share|improve this answer













                  ===============
                  // refresh.php
                  ===============

                  <?php
                  require("connection.php");
                  $sql_cmd = "SELECT * FROM tbstatus";
                  $stmt = $con->prepare($sql_cmd);
                  $stmt->execute();

                  echo "<h2>STATUS OF THE BABY</h2>";

                  while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                  echo "<h4>" . $result['status'] . "</h4>";
                  echo "<script> alert('". $result['status'] ."'); </script>";
                  /* If the $result['status'] is 'success' the above line will be converted to:
                  echo "<script> alert('success'); </script>";
                  */
                  }

                  ?>


                  so, every time the refresh.php loads, the script is going to get executed.



                  However, I suggest you to assign a id or class attribute to your h4 where you are echoing your status and access the value using the selectors in the javascript.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '18 at 6:30









                  new_usernew_user

                  1,3451018




                  1,3451018























                      -1















                      1. you could try giving an id or class to the status.

                      2. then in JavaScript you could then get the value of the id or class.


                      PHP



                      <?php
                      require("connection.php");

                      $sql_cmd = "SELECT * FROM tbstatus";

                      $stmt = $con->prepare($sql_cmd);
                      $stmt->execute();

                      echo "<h2>STATUS OF THE BABY</h2>";
                      while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                      echo '<h4> <span class="status">' . $result['status'] . '</span></h4>';
                      }

                      ?>


                      JavaScript



                      var oldStatus = '';

                      setInterval(function() {
                      $("#position").load('refresh.php');
                      notif();
                      }, 1000);

                      function notif() {
                      // note that since we used a class, you will get the value of the first element only.
                      var pos = $('.status').text(); // use .text() instead of .val()
                      if (pos.toLowerCase() == 'out' && pos != oldStatus){
                      oldStatus = pos;
                      alert(pos);
                      }
                      }





                      share|improve this answer


























                      • It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                        – Gerald Manibale
                        Nov 23 '18 at 6:27











                      • replace setInterval with setTimeout

                        – marvinIsSacul
                        Nov 23 '18 at 7:10











                      • If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                        – Gerald Manibale
                        Nov 23 '18 at 7:21











                      • i've modified my answer. check it out.

                        – marvinIsSacul
                        Nov 23 '18 at 7:25











                      • I don't understand this. I want it to notify me when the status is "Out".

                        – Gerald Manibale
                        Nov 23 '18 at 8:01
















                      -1















                      1. you could try giving an id or class to the status.

                      2. then in JavaScript you could then get the value of the id or class.


                      PHP



                      <?php
                      require("connection.php");

                      $sql_cmd = "SELECT * FROM tbstatus";

                      $stmt = $con->prepare($sql_cmd);
                      $stmt->execute();

                      echo "<h2>STATUS OF THE BABY</h2>";
                      while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                      echo '<h4> <span class="status">' . $result['status'] . '</span></h4>';
                      }

                      ?>


                      JavaScript



                      var oldStatus = '';

                      setInterval(function() {
                      $("#position").load('refresh.php');
                      notif();
                      }, 1000);

                      function notif() {
                      // note that since we used a class, you will get the value of the first element only.
                      var pos = $('.status').text(); // use .text() instead of .val()
                      if (pos.toLowerCase() == 'out' && pos != oldStatus){
                      oldStatus = pos;
                      alert(pos);
                      }
                      }





                      share|improve this answer


























                      • It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                        – Gerald Manibale
                        Nov 23 '18 at 6:27











                      • replace setInterval with setTimeout

                        – marvinIsSacul
                        Nov 23 '18 at 7:10











                      • If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                        – Gerald Manibale
                        Nov 23 '18 at 7:21











                      • i've modified my answer. check it out.

                        – marvinIsSacul
                        Nov 23 '18 at 7:25











                      • I don't understand this. I want it to notify me when the status is "Out".

                        – Gerald Manibale
                        Nov 23 '18 at 8:01














                      -1












                      -1








                      -1








                      1. you could try giving an id or class to the status.

                      2. then in JavaScript you could then get the value of the id or class.


                      PHP



                      <?php
                      require("connection.php");

                      $sql_cmd = "SELECT * FROM tbstatus";

                      $stmt = $con->prepare($sql_cmd);
                      $stmt->execute();

                      echo "<h2>STATUS OF THE BABY</h2>";
                      while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                      echo '<h4> <span class="status">' . $result['status'] . '</span></h4>';
                      }

                      ?>


                      JavaScript



                      var oldStatus = '';

                      setInterval(function() {
                      $("#position").load('refresh.php');
                      notif();
                      }, 1000);

                      function notif() {
                      // note that since we used a class, you will get the value of the first element only.
                      var pos = $('.status').text(); // use .text() instead of .val()
                      if (pos.toLowerCase() == 'out' && pos != oldStatus){
                      oldStatus = pos;
                      alert(pos);
                      }
                      }





                      share|improve this answer
















                      1. you could try giving an id or class to the status.

                      2. then in JavaScript you could then get the value of the id or class.


                      PHP



                      <?php
                      require("connection.php");

                      $sql_cmd = "SELECT * FROM tbstatus";

                      $stmt = $con->prepare($sql_cmd);
                      $stmt->execute();

                      echo "<h2>STATUS OF THE BABY</h2>";
                      while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
                      echo '<h4> <span class="status">' . $result['status'] . '</span></h4>';
                      }

                      ?>


                      JavaScript



                      var oldStatus = '';

                      setInterval(function() {
                      $("#position").load('refresh.php');
                      notif();
                      }, 1000);

                      function notif() {
                      // note that since we used a class, you will get the value of the first element only.
                      var pos = $('.status').text(); // use .text() instead of .val()
                      if (pos.toLowerCase() == 'out' && pos != oldStatus){
                      oldStatus = pos;
                      alert(pos);
                      }
                      }






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 23 '18 at 8:50

























                      answered Nov 23 '18 at 6:13









                      marvinIsSaculmarvinIsSacul

                      53718




                      53718













                      • It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                        – Gerald Manibale
                        Nov 23 '18 at 6:27











                      • replace setInterval with setTimeout

                        – marvinIsSacul
                        Nov 23 '18 at 7:10











                      • If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                        – Gerald Manibale
                        Nov 23 '18 at 7:21











                      • i've modified my answer. check it out.

                        – marvinIsSacul
                        Nov 23 '18 at 7:25











                      • I don't understand this. I want it to notify me when the status is "Out".

                        – Gerald Manibale
                        Nov 23 '18 at 8:01



















                      • It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                        – Gerald Manibale
                        Nov 23 '18 at 6:27











                      • replace setInterval with setTimeout

                        – marvinIsSacul
                        Nov 23 '18 at 7:10











                      • If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                        – Gerald Manibale
                        Nov 23 '18 at 7:21











                      • i've modified my answer. check it out.

                        – marvinIsSacul
                        Nov 23 '18 at 7:25











                      • I don't understand this. I want it to notify me when the status is "Out".

                        – Gerald Manibale
                        Nov 23 '18 at 8:01

















                      It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                      – Gerald Manibale
                      Nov 23 '18 at 6:27





                      It's working now. Thank You. But I have a little bit concern. Since I have setInterval in my js, every second it will alert me with the value of status. I want is to just alert me once, if the value of the status does not change. Is it possible? Thank you

                      – Gerald Manibale
                      Nov 23 '18 at 6:27













                      replace setInterval with setTimeout

                      – marvinIsSacul
                      Nov 23 '18 at 7:10





                      replace setInterval with setTimeout

                      – marvinIsSacul
                      Nov 23 '18 at 7:10













                      If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                      – Gerald Manibale
                      Nov 23 '18 at 7:21





                      If I use setTimeout, it will not automatically refresh my web. I needed that to get the latest value from my database

                      – Gerald Manibale
                      Nov 23 '18 at 7:21













                      i've modified my answer. check it out.

                      – marvinIsSacul
                      Nov 23 '18 at 7:25





                      i've modified my answer. check it out.

                      – marvinIsSacul
                      Nov 23 '18 at 7:25













                      I don't understand this. I want it to notify me when the status is "Out".

                      – Gerald Manibale
                      Nov 23 '18 at 8:01





                      I don't understand this. I want it to notify me when the status is "Out".

                      – Gerald Manibale
                      Nov 23 '18 at 8:01


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441073%2fusing-variable-on-php-to-create-another-variable-in-js%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      這個網誌中的熱門文章

                      Hercules Kyvelos

                      Tangent Lines Diagram Along Smooth Curve

                      Yusuf al-Mu'taman ibn Hud