Skip to main content

Posts

Showing posts from January, 2015

[symfony] cookie

 $userCookie = [             'name' => 'survey_send_recommend_email',             'value' => $reci         ];         $cookieValue = $request->cookies->get($userCookie['name'], '');         if ($cookieValue == $userCookie['value']) {             return new Response("Already sent email to $reci");         } --------------------------- $response = new Response('success');         $response->headers->setCookie(             new Cookie(                 $userCookie['name'],                 $userCookie['value'],                 time() + (3600 * 24 * 7),                 '/', ...

[jquery] ajax

$.ajax({                 type: $form.attr('method'),                 url: $form.attr('action'),                 data: $form.serialize(),                 beforeSend: function() {                     $submitButton.attr('disabled', 'disabled');                 },                 complete: function() {                     $submitButton.removeAttr('disabled');                 },                 success: function(data) {                     if ('success' != data) {               ...