send javaScript variable to php variable
- by mrbunyrabit
First i thought that i had to convert javascript to php, but then i found out that cant because of server and client side executions. So now I simply want to send ONE variable
<script type="text/javascript">
function scriptvariable()
{
var theContents = "the variable";
}
</script>
to a php variable
<?php
$phpvariable
?>
That function in the javascript executes when lets say i click on a button.
Now i have Nooo idea how to get that phpvariable Equal to the javascript one so i can use that phpvariable to look up stuff in my Database.
I know i can add it to my url or some thing, and just refresh the page.. But id like to do it with AJAX as further in my webpage i might have to use this Ajax method..
So is there an easy way to do this without having to dump pages of code on my page to do one simple thing?