Posts

Showing posts with the label Url

Laravel using Cookies to Save URL Question Mark Parameter

Image
In Laravel most of the time cookies are set by the response .Further most of the posts does not directly tell how to retire URL Get  parameters. Eg: https://www.blogger.com/? blogID=1441573773987640178 To retrieve the value we can take the value in routes >>web.php Route::get('/', function(){      $term = Input::get(' blogID ');       if(isset($term)){         Cookie::queue(Cookie::make(' blogID ',$term, 60*24*365));       }     return view('home'); }); In here cookies are save using (Cookie::make) . In the next response the cookie value get saved in client browser.               e.g.  $cookie = Cookie :: make ( $name , $value , 60 ); http://laravel-recipes.com/recipes/48/creating-a-new-cookie To retrieve the Cookies value is simple       $request->cookie(' blogID ');

Url encode decode anchor links with AngularJS PHP

Image
I had following link  in one of rest call which lead to SQL unexpected result due to & symbol. http://localhost/test/getDsv?$top=32&$skip=0&var=HR & Admin&com= Query has only considered  var=HR   only  which leads to unexpected results. My front end is anguler and I can encode the perticulter paramenter with  window . encodeURIComponent() Ref : http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax To Decode it at PHP side there in nothing to do ,although there are lot of posts ,which indicate decoding. $this->_request['var']; http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax