Skip to content
Advertisement

PHP MVC not sending value to controller

I have been making a MVC site, I am having trouble sending the row id from my form to my controller.

The code that I am using for my form gets the row ID for each db entry and assigns it to a hidden value. When the form is submitted it sends the parameters to the controller (should send $uid) but the uid isn’t making it to the controller.

Form Code (buttons.php)

JavaScript

Controller function

JavaScript

View.php – where I am showing the list of db items and the buttons.php

JavaScript

Advertisement

Answer

Okay,

  1. step by step the $uid has to first make it into the form elements value attribute. Check the html source code to make sure this is actually happening.

  2. place var_dump($_POST) exit; in your controller to find what is actually being recieved if anything at all.

  3. check to make sure your result array element actual has a value and not an empty string value or NULL.

Hmm S.O. code formatting bad.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement