I have following code: How can i get the name of file i upload so i can save the path to database? I need only name of file, not the whole path. Thank you Answer
Tag: forms
Rendering multiple forms on same page with Symfony 3
I’d like to show a login and a registration form on the same page. However it seems that we cannot render the same template with different form variables in different two actions in a controller. Here is what I mean; } Above I have my login and registration action. I’d like to pass the ‘form’ variable to the same twig
Insecure PHP Login Form Exercise (Returns no errors, can’t figure it out.)
I have a Login script (it’s a basic demonstration exercise of PHP for the web class i’m in) that is insecure, but intentionally so. Advice regarding exploits will go unnoticed, as this is for testing …
How to create a custom SaveType which is child of SubmitType in Symfony forms
I want to make some simple admin panel application in Symfony. I see that since version 2.3 Symfony introduced a Bootstrap’s form theming, which is great, but I want to create custom submit field called SaveType which should have default class attr set to btn-primary instead of btn-default. So, from documentation I read that I can create that custom field
Specific email conditional on Radio Button selected in Form
Thank you for all the info here, but I seem to be missing something to make it send to each particular email address. Basis for this code came from thread: Send PHP Form to Different Emails Based on Radio Buttons Answer EDIT: HTML PHP
How can I sanitize laravel Request inputs?
I have MyRequest.php class extending AppHttpRequestsRequest. I want to trim() every input before validation because an e-mail with a space after it does not pass validation. However sanitize() was …
How does a PHP page retrieve form data?
I am new to PHP and am taking the PHP course on W3Schools. In the form handling part of the course, I read that there are two methods of handling form data: POST and GET. I understand that depending on the method used, a superglobal variable is created which stores the data as key-value pairs. And at the destination page,
How to show PHP Duplicate Entry error message on current page
I am creating a signup form for a website I am developing. I am using PHP to insert the form into my database. I have the useremail set as a Unique Key in my database. When I type in an email that already exists in my database it brings me to a blank page with this error message: Duplicate entry
Laravel – Form validation error – argument 2 must be array
I’m working with Laravel and every time I submit my form it gives me this error: ErrorException in Factory.php line 91: Argument 2 passed to IlluminateValidationFactory::make() must be of the type array, null given, called in /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php on line 83 and defined This is some code for the controller, even when I don’t try to send data to the database
Symfony form collection rendering
I’m using symfony 2.3 I have form with field of type “collection” Visualization code in twig: Everything work, expect when form.fields is empty. Then nothing is visualized in twig loop, witch is fine. But at the end of the form there is “label” for the element “form.fields”. Only label. Workaround: If there are elements, they will be rendered in the