Please help. I needed an answer to my question regarding getting textarea to php VIA javascript.
SORRY to say this, but people answered that PHP gets the variable already. However, I already KNOW this. I MUST use Javascript. If you would like to know why, I will tell you. I am NOT submitting a form. I don't want to submit a form. I am using an onclick Javascript window opener (clicking on some text opens up a text window, duplicating what the user just filled in), and this is done via the Javascript variable: "document.form1.textarea.value"
My question is how do I get THAT into PHP??? PHP will ONLY capture the original textarea variable if the form is submitted via get or post. I am not submitting at all. I don't want to, for my own personal reasons.
I will post my original question here:
When I type into textarea, and click the "submit button," the "javascript variable"
that holds what the visitor typed is this:
document.form1.textarea.value
My question is: On that next page that appears, how can I store that Javascript
variable in a PHP variable?
I mean, do I put the php stuff into my javascript tags? Nothing I try seems to
work. Here is an example of what I tried:
<SCRIPT LANGUAGE="JavaScript">
<?php
$my_variable = "document.form1.textarea.value";
?>
</SCRIPT
but, of course, that doesn't work.
You may ask why I want to do this? Well, the reason is that after Javascript is
used (I MUST use Javascript for programming reasons), I want PHP to store that
variable into a mySQL database.