Created
February 3, 2015 21:52
-
-
Save anonymous/11c28240c23f24be6bd5 to your computer and use it in GitHub Desktop.
slim can't catch an options array well formed by html (+twig) named sel [ ].
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insert | |
$app->post('/insvei1',function () use ($app) { | |
include_once('includes/menu.php'); | |
$id = $app->request()->post('idvei'); | |
$sel = $app->request()->post('sel[]'); | |
$conn = new MongoClient('mongodb://localhost'); | |
$db = $conn->tasks; | |
$collection = $db->manupcars; | |
$document = array( | |
"idcar" => new MongoId($id), | |
"idman" => new MongoId($sel) | |
); | |
$collection->insert($document); | |
$link = $app->urlFor('mpclist'); | |
$app->redirect($link); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment