RE: how i assign a js variable to a php variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >> 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!
> >
> > I am quite sure that is what he meant, since I cannot count people
> > reading <?php ?> in the middle of the page thinking it can interact
> > directly with nodes and javascript, and being "a new one", I think
> > Ash replied in the correct way.
> >
> > Regards
> >
> All true, and probably appropriate to clarify the relationship between
> php and js.
> 
> However, if the goal is to pre-set something in php land so you don't
> have to pass it with your next page navigation, you could use ajax to
> to pass the value to a simple php script that in turn updates a php
> session variable, so that it is already set when you do your next real
> page load.
> 
> You would still be "calling a page" technically, but your current
> displayed page would remain in place and php would have the value
> available on its next page load.
> 

Very true. I really didn't intend to dismiss everything you said Ash. I
apologize for that. You were absolutely correct in your statement about not
being able to directly assign the value of a javascript variable to a PHP
variable. I just felt that your response would leave the reader to believe
that that wasn't any way to pass the value at all. In my attempt to throw my
two cents in I essentially did the same to your response. I'm afraid I left
some thinking I was dismissing your entire statement. Sorry about that.



Thank you,
Marc Hall
HallMarc Websites
610.446.3346


[HallMarc Websites] 
 

__________ Information from ESET Smart Security, version of virus signature
database 4435 (20090917) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux