I’m creating my first custom EE module. So far so good, but I have a form that allows the user to create a new record in the database. I’m sending POST data to the exact same URL that the user is on (ex: /index.php?S=978b40a8d23a6cb344283e0cddf7a0ad28c5be67&D=cp&C=addons_modules&M=show_module_cp&module=builder_db&method=add_builder), but all that happens is the user gets kicked out to the back end home page. What am I missing here that needs to be done? The form loads fine but when I POST data, why isn’t it firing the method that I’ve defined in my MCP (ex: mcp.mymodule.php) file?
–
NOTE: I’ve tried changing the “method” in the action URL to something unique and creating corresponding functions in the MCP file but I simply can’t get anything to work. It seems it’s not loading my MCP file at all…
–
NOTE: All form submissions are returning with a “302 Found” status code. It should be returning 200. What could be causing this? Here’s a sample of what happens with a typical POST of data:
POST /index.php?S=978b40a8d23a6cb344283e0cddf7a0ad28c5be67&D=cp&C=addons_modules&M=show_module_cp&module=builder_db&method=add_builder
Returns 302 Found
GET /index.php?S=978b40a8d23a6cb344283e0cddf7a0ad28c5be67&D=cp
Returns 302 Found
GET /index.php?S=978b40a8d23a6cb344283e0cddf7a0ad28c5be67&D=cp&C=homepage
Returns 200 OK and the CP Home page loads.
–
NOTE: I can confirm this is not .htaccess related.
–
Running ExpressionEngine Version 2.1.3 Build 20101220
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.