[Javascript] calling js function from php

suresh kumar asureshkumar_1983 at yahoo.co.in
Mon May 29 10:38:10 CDT 2006


i am facing  some problems in my project.
   
  1) i want to call a javascript function from php. this is my code.
  <script type="text/javascript">
   function confirmask()
{         
         
       var con=confirm("you are trying to cancel a mirrored display location.Do u want to continue");
       if(con==true){
         return 1;
       }
       else if(con==false){
        return 0;
        
       }
      
  }
  </script>
   
   
   
  <?
  $res=confirmask();
        if($res==1){
        
                $deletelocationresult=mysql_query(" update users set Status='0' where SponsorID='$editlocationid'");
                if(mysql_affected_rows($deletelocationresult)):
                        print "<script type=\"text/javascript\">
                     alert(\"mirrored display location is deleted successfully\");
                  location.replace(\"displaylocationprofile.php\");
                  </script>";
                        exit();
                 endif;
        }
        else {
                     print "<script type=\"text/javascript\">
                     
                  location.replace(\"displaylocationprofile.php\");
                  </script>";
                        exit();
        } ?>
   
   
  2)   how can i assign a  javascript variable to php 
   

				
---------------------------------
  How should a woman equip herself to travel safe even when she's unescorted? Share your knowledge with real people on Yahoo! India Answers
 Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060529/32f8e1f3/attachment.htm>


More information about the Javascript mailing list