Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] calling js function from php


  • From: joao at curitibaonline.com.br (João Cândido de Souza Neto)
  • Subject: [Javascript] calling js function from php
  • Date: Mon May 29 11:29:56 2006

Unfortunatly you can?t do this.

PHP is a server-side script and javascript is a client-side, because it, one can?t run another.

  ----- Original Message ----- 
  From: suresh kumar 
  To: javascript@xxxxxxxxxx 
  Sent: Monday, May 29, 2006 12:38 PM
  Subject: [Javascript] calling js function from php


  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


------------------------------------------------------------------------------


  _______________________________________________
  Javascript mailing list
  Javascript@xxxxxxxxxx
  https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20060529/884eb7b3/attachment.html