Reputation: 885
I have a form with multiple fields. Some file and input. I was working on it for some time. Everything was working as it should be until a few hours back suddenly the form is not submitting to the right. I have no idea what went wrong. Action to submit the form is the same as the view it generated. After i submit the form browser does not show anything default template address stays the same as the form submits to same view. But i do have redirect statement if the data is saved correctly..
As the form is submitted browser goes blank, not even the default template is shown ... and to add to my pain no errors ... Things are looking worse as they are.. So would really appreciate any pointers.. Thank You.
Upvotes: 1
Views: 134
Reputation: 1468
A quick thing to check for is if there are any whitespace characters at the end of your models or controllers (actually, any .php file) after the '?>' That can cause the behavior you describe.
<?php
class YourController extends AppController {
/*** your code here ***/
}
?>(whitespace chars here)
Something that I do that helps with this problem is to remove the '?>' on my models and controllers. The php interpreter will consider the EOF as the closing tag.
<?php
class YourController extends AppController {
/*** your code here ***/
}
// END
@webbiedave has good advice too, cake has great debugging, although you may need to add the following to your layout template depending on which version of cake you are using...
<?php echo $this->element('sql_dump'); ?>
I put it right at the end of my default template
Upvotes: 1
Reputation: 6571
<form action=...
code.With the code, we can help you debug the problem.
To ensure that you can see any errors generated by PHP, open app/config/core.php
in your editor and search for debug. Set the debug level to 2 - Configure::write('debug',2);
Upvotes: 0