tags:

views:

41

answers:

2

Hi !

Can U tell me how to take Value From java Scrpit File and send it to php File .

code :

var year      = (year != null) ? year : '".$this->arrToday["year"]."';


var month     = (month != null) ? month : '".$this->ConvertToDecimal($this>arrToday["mon"])."';


var day       = (day != null) ? day : '".$this->arrToday["mday"]."';


my_window= window.open ('Event.php','mywindow1','status=1,width=350,height=150'); 

\\

and I wont to send these varible (year,Month,day) to Event.php .

can U tell me How ?

+1  A: 

You can use ajax to send JS variables to php (look at jQuery), but you can't execute php code through javascript. Another way (if you must use those variable in a new page) is to pass js variables as GET variables something like:

my_window= window.open ('Event.php?year=2010','mywindow1','status=1,width=350,height=150');

and in php:

echo $_GET["year"]; //prints 2010
mck89
A: 
var url = "event.php?year="+year+"&month="+month+"&day"+day;

var win1 = window.open(url,"File name","height=150,width=350,fullscreen=0,location=1,menubar=0,resizable=0,scrollbars=1,status=1,toolbar=0,left=0,top=30");

win1.focus();

In event.php file

Use $_GET['day'], $_GET['month'], $_GET['year'] to get the values

RSK
Thanks for all ..It's work now : )
Nina