i have a get route,
function getDetialForm(){
//Here i have to pass 2 value to let function know which form i need, something like product_id, or category_id
// So how can i do more security for these input val? i am afraid that ppl will sql inject that.
// here is what i will do
$product = Product::Find(Input::get('product_id'));
$category = Category::Find(Input::get('category_id'));
if($product && $category){
//do something you like
}
}
Route::filter('old', function()
{
if (Input::get('age') < 200)
{
return Redirect::to('home');
}
});
Eloquent automatically prevent SQL Injection so you dont need it. For XSS prevent use e() function which escape string.
$user->bio = e(Input::get("bio"));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community