Allowing a field not to be filled in.
Moderator: mkoch227
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Allowing a field not to be filled in.
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Hey,
I created another message box, as in message2, but when i dont fill it in, at new_ticket.php, it doesn't send. It gives me an error of which i'm certain is about the message2 field. How do i allow that field to be empty?
Greets
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Hey,
I created another message box, as in message2, but when i dont fill it in, at new_ticket.php, it doesn't send. It gives me an error of which i'm certain is about the message2 field. How do i allow that field to be empty?
Greets
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Re: Allowing a field not to be filled in.
Code: Select all
$tmpvar['name'] = hesk_input($_POST['name']) or $hesk_error_buffer[]=$hesklang['enter_your_name'];
$tmpvar['email'] = hesk_validateEmail($_POST['email'],'ERR',0) or $hesk_error_buffer[]=$hesklang['enter_valid_email'];
$tmpvar['category'] = hesk_input($_POST['category']) or $hesk_error_buffer[]=$hesklang['sel_app_cat'];
$tmpvar['priority'] = ($hesk_settings['cust_urgency'] ? intval($_POST['priority']) : 3) or $hesk_error_buffer[]=$hesklang['sel_app_priority'];
$tmpvar['subject'] = hesk_input($_POST['subject']) or $hesk_error_buffer[]=$hesklang['enter_ticket_subject'];
$tmpvar['message'] = hesk_input($_POST['message']) or $hesk_error_buffer[]=$hesklang['enter_message'];
$tmpvar['message2'] = hesk_input($_POST['message2']) or $tmpvar['message2'] = '';
I got this from another post ( see the last line in the code ), but it does not work for me. Does this have something to do with my database?
Re: Allowing a field not to be filled in.
Try removing
Code: Select all
or $tmpvar['message2'] = ''
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Re: Allowing a field not to be filled in.
Thank you for the quick reply,
But that does not work.
Still getting the error stating there is some information missing.
Code is now:
But that does not work.
Still getting the error stating there is some information missing.
Code is now:
Code: Select all
$tmpvar['message2'] = hesk_input($_POST['message2']);
Re: Allowing a field not to be filled in.
But it's not the 'message2' field that is generating it if you have that code...
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Re: Allowing a field not to be filled in.
It is, because when i do fill a random number/letter in, it does not give me that error.
The field is causing this problem, imo.
Thank you
The field is causing this problem, imo.
Thank you
Re: Allowing a field not to be filled in.
Try changing that code to just
You still get the errors, don't you?
Code: Select all
$tmpvar['message2'] = 'test';
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Re: Allowing a field not to be filled in.
Indeed, i do still get the errors. Can you explain to me what i need to do? Because I think it depends on that field because when i DO fill it in, i dont get the errors.
does it have something to do with:
does it have something to do with:
Code: Select all
else
{
if ($v['req'])
{
$hesk_error_buffer[]=$hesklang['fill_all'].': '.$v['name'];
}
$_POST[$k] = '';
Re: Allowing a field not to be filled in.
I don't know how you modified it so I can't be of much help nor do I officially support third party customizations.
I showed you it's not that field or you have some other code that's checking the same field again, but again supporting such modifications is out of the scope of my support here, sorry.
I showed you it's not that field or you have some other code that's checking the same field again, but again supporting such modifications is out of the scope of my support here, sorry.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools