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
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.
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
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
@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
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
-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
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
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 Linkedin
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
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!
-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
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
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
14 matches
Mail list logo