Jump to content

Javascript variable to php variable


jeet_0077

Recommended Posts

Hi

Can some one help me on how to assign a javascript value to php variable.

 

Say I have a script like this:

<script>

var jsVariable = 'some value';

</script>

 

I need that value to be assigned in a php variable

$phpVariable

 

I know that I can redirect the page with the variable as : http://domain.com/pagename.php?var=jsVariable with javascript

and in the page I can get this value there.

 

But I need in the same page and I cant refresh the page as well.

 

Please help.

Thanks in Advance.

Link to comment
https://forums.phpfreaks.com/topic/90104-javascript-variable-to-php-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.