Re: [PHP] how i assign a js variable to a php variable

2009-09-19 Thread tedd
At 2:16 AM +0700 9/18/09, saeed ahmed wrote: hello guys, i'm new here in this list. guys i need a help. i can't assign a js variable value to a php variable. how can i do this? saeed: Considering that js is client-side and php is server-side, you need to pass the value via a communication

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Gautam Bhatia
hello, You can also try using AJAX technology to communicate with the server side code that is your php :). Regards, Gautam Bhatia Punjab,India mail2gautambha...@gmail.com On Fri, 2009-09-18 at 02:16 +0700, saeed ahmed wrote: hello guys, i'm new here in this list. guys i need a help.

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
Or you can also do this way: on loading ?php [...] echo input type='hidden' name='myphpvar' id='myphpvar' value='.$myphpvar.'; [...] echo input type='button' name='mybutton' id='mybutton' onclick='javascript:recalculateValue();' value='Click Me!' ; [...] ? script type=text/javascript functino

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
basicly is use hidden inputs as a container for php variables, and transform through js. really? I though the other way round was extremely simple: echo 'script type=text/javascriptvar myPHPvar=eval(('.addslashes(json_encode($myPHPvar)).'));/script'; why would you use hidden input, plus

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
@lists.php.net Date: Fri, 18 Sep 2009 13:01:28 +0200 Subject: RE: [PHP] how i assign a js variable to a php variable basicly is use hidden inputs as a container for php variables, and transform through js. really? I though the other way round was extremely simple: echo 'script type=text

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
i assign a js variable to a php variable basicly is use hidden inputs as a container for php variables, and transform through js. really? I though the other way round was extremely simple: echo 'script type=text/javascriptvar myPHPvar=eval(('.addslashes(json_encode($myPHPvar

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
-general@lists.php.net Date: Fri, 18 Sep 2009 13:01:28 +0200 Subject: RE: [PHP] how i assign a js variable to a php variable basicly is use hidden inputs as a container for php variables, and transform through js. really? I though the other way round was extremely simple: echo

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
You can not pass this myPHPvar javascript var as an input in a form. if you want to change its value and maintein it, must to use an static var, and only can access to this values via javascript functions where an event is invoked (in case you want to read or write values) with all due

Re: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread Ashley Sheridan
On Fri, 2009-09-18 at 02:16 +0700, saeed ahmed wrote: hello guys, i'm new here in this list. guys i need a help. i can't assign a js variable value to a php variable. how can i do this? -- Regards, Saeed Ahmed Rajshahi, Bangladesh Blog: http://saeed05.wordpress.com -- Follow Me

RE: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread Andrea Giammarchi
I have to disagree Ash, you can pass js variable values to PHP but only through a page load. Then you could use $_REQUEST, $_POST, $_GET to retrieve it. I have done this before. And I am sure Ash does it on daily basis, the problem is the used therm: I want to *assign* ... not pass, assign!

RE: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread HallMarc Websites
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Thursday, September 17, 2009 3:19 PM To: saeed ahmed Cc: php-general@lists.php.net Subject: Re: [PHP] how i assign a js variable to a php variable On Fri, 2009-09-18 at 02:16 +0700, saeed ahmed wrote

Re: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread Phred White
On Sep 17, 2009, at 2:43 PM, Andrea Giammarchi wrote: I have to disagree Ash, you can pass js variable values to PHP but only through a page load. Then you could use $_REQUEST, $_POST, $_GET to retrieve it. I have done this before. And I am sure Ash does it on daily basis, the problem

RE: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread HallMarc Websites
I have to disagree Ash, you can pass js variable values to PHP but only through a page load. Then you could use $_REQUEST, $_POST, $_GET to retrieve it. I have done this before. And I am sure Ash does it on daily basis, the problem is the used therm: I want to *assign* ... not