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 m
> 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
gt; From: an_...@hotmail.com
>> > To: jonathan.desarro...@gmail.com; mail2gautambha...@gmail.com
>> > CC: saeed@gmail.com; php-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 variab
myPHPvar='.json_encode($myPHPvar).';';
>
> that's pretty much it
>
> > From: an_...@hotmail.com
> > To: jonathan.desarro...@gmail.com; mail2gautambha...@gmail.com
> > CC: saeed@gmail.com; php-general@lists.php.net
> > Date: Fri, 18 Sep 200
sts.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 ro
> 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 'var
myPHPvar=eval("('.addslashes(json_encode($myPHPvar)).')");';
why would you use hidden input, plus DOM to get data, etc, etc?
_
Or you can also do this way:
on loading
";
[...]
echo "
functino recalculateValue(){
var myText = document.getElementById("myphpvar");
var myValue = myText.value;
/*
operations with myText
*/
myText.value = myRecalcValue;
}
once changed, you choose how to proceed, maybe executing any other
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
> >> 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 *
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 pass, assig
> -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-
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
> --
> F
13 matches
Mail list logo