How to send javascript variable data to php

I want to send a javascript variable which contains an image base64 (png) value (Too big for GET requests). How do i send this base64 value to the php page (POST request) so as to decode base64 and then save it. \[code\]var base64 = this.tobase64(); // store base64 value to this variable $.post('/js/uploadify/handler.php', {basevalue: base64}); }); window.location = "http://localhost/file/handler.php";\[/code\]I tried the above code but it does not work, I want to send the value with an onclick event on a button (which is not a submit button). I am not using forms.PHP CODE\[code\]$val = $_POST['basevalue'];echo $val;\[/code\]I get Notice: Undefined index: basevalue errorthanks!.
 
Back
Top