Connecting Tech Pros Worldwide Help | Site Map

calling js into php

chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Posts: 86
#1: Sep 23 '08
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's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#2: Sep 23 '08

re: calling js into php


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.
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Posts: 86
#3: Sep 24 '08

re: calling js into php


Quote:

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

Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'><!--
  2. function loadSite(){
  3. window.location ='home.php?$u_n';
  4. }
  5. --></script>
  6.  


then my php here i check
Expand|Select|Wrap|Line Numbers
  1. if($agree =!isset($_POST['t19']) ){
  2. //inserting query
  3. }
  4. else{
  5. echo"<script type='text/javascript'>
  6.                                                                                         <!--
  7.                                                                                         loadSite();
  8.  
  9.                                                                                         -->
  10.                                                                                         </script>";
  11. }
  12.  
on the above php's else block worked always. that not dependent on the condition

thanks

chel-1
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#4: Sep 24 '08

re: calling js into php


Quote:

Originally Posted by chelvan

hi
here my codes

Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'><!--
  2. function loadSite(){
  3. window.location ='home.php?$u_n';
  4. }
  5. --></script>
  6.  


then my php here i check
Expand|Select|Wrap|Line Numbers
  1. if($agree =!isset($_POST['t19']) ){
  2. //inserting query
  3. }
  4. else{
  5. echo"<script type='text/javascript'>
  6.                                                                                         <!--
  7.                                                                                         loadSite();
  8.  
  9.                                                                                         -->
  10.                                                                                         </script>";
  11. }
  12.  
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
Expand|Select|Wrap|Line Numbers
  1. !isset($_POST['t19'])
  2.  
will return.
chelvan's Avatar
Member
 
Join Date: Aug 2008
Location: Colombo 06, Srilanka
Posts: 86
#5: Sep 25 '08

re: calling js into php


Quote:

Originally Posted by Markus

Is $agree a boolean value? Because that's what

Expand|Select|Wrap|Line Numbers
  1. !isset($_POST['t19'])
  2.  
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
Reply