calling js into php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chelvan
    New Member
    • Aug 2008
    • 90

    calling js into php

    hi
    all


    i've a js function. i'm trying to call that on php script. before that i just check a condition when the conditions become true, i called that js. but that js function not depended on that condition, it always worked. why?


    chel-1
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    I'm sorry but I don't understand your question too clearly.

    You're asking me (and others) about something we can't see and, therefore, can't possibly begin to know the problem. Che1, you've been here long enough to know that for us to help you, you need to help us. It's a simple as that.

    Comment

    • chelvan
      New Member
      • Aug 2008
      • 90

      #3
      Originally posted by Markus
      I'm sorry but I don't understand your question too clearly.

      You're asking me (and others) about something we can't see and, therefore, can't possibly begin to know the problem. Che1, you've been here long enough to know that for us to help you, you need to help us. It's a simple as that.
      hi
      here my codes

      Code:
      <script type='text/javascript'><!--
      function loadSite(){
      window.location ='home.php?$u_n';
      }
      --></script>


      then my php here i check
      Code:
      if($agree =!isset($_POST['t19']) ){
      //inserting query
      }
      else{
      echo"<script type='text/javascript'>
      																						<!--
      																						loadSite();
      
      																						-->
      																						</script>";
      }
      on the above php's else block worked always. that not dependent on the condition

      thanks

      chel-1

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by chelvan
        hi
        here my codes

        Code:
        <script type='text/javascript'><!--
        function loadSite(){
        window.location ='home.php?$u_n';
        }
        --></script>


        then my php here i check
        Code:
        if($agree =!isset($_POST['t19']) ){
        //inserting query
        }
        else{
        echo"<script type='text/javascript'>
        																						<!--
        																						loadSite();
        
        																						-->
        																						</script>";
        }
        on the above php's else block worked always. that not dependent on the condition

        thanks

        chel-1
        Is $agree a boolean value? Because that's what
        [code=php]
        !isset($_POST['t19'])
        [/code]
        will return.

        Comment

        • chelvan
          New Member
          • Aug 2008
          • 90

          #5
          Originally posted by Markus
          Is $agree a boolean value? Because that's what
          [code=php]
          !isset($_POST['t19'])
          [/code]
          will return.
          ya thats checked combobox is checked or not.returns boolean. if checked that will insert something to database. if not i call the javascript. but the javascript work on both condition.


          chel-1

          Comment

          Working...