Re: Access $_POST variables from Javascript?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Access $_POST variables from Javascript?

From: |-|erc <h@r.c>
Date: Mon Aug 22 2005 - 06:02:20 CEST

"Robert Oschler" <no-mail-please@nospam.com> wrote in ...
> I know there isn't any $_POST array in Javascript, it exists on the server
> side accessible from PHP and other server side scripting languages. But I
> knew it would let you know specifically what data I'm after.
>
> Is there any way to get the data that is POSTED to a web page from
> client-side Javascript? Or does only the server get access to it?
>
> I can get access to the URL/href data from the "search" property, but
that's
> because it's part of the URL. What about POST'ed data?
>

You can read $_GET from the URL!

For posted variables you have to write the PHP variables to Javascript
variables.

<script>
<? php echo "var1 = " . $_POST("var1"); ?>

</script>

Herc
Received on Mon Oct 24 02:14:16 2005