set cookie through jquery in php

 <script type="text/javascript">
$(document).ready(function() {
    $("#currency").change(function() {
var id = $(this).val();
        $.ajax({
            url: 'current.php',
            type: 'POST',
            data:{'id':$(this).val()},
            success: function(data)
            {
        location.reload();

            }
        });
    });
});
</script>



current.php


<?php
$id=$_POST['id'];
setcookie("to",$id);
?>

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.