Posts: 10
Threads: 2
Joined: Apr 2013
2013-04-11, 09:11:16
(This post was last modified: 2013-04-11, 09:12:53 by dblewett.)
I copied the Tag Examples from http://nliautaud.fr/wiki/travaux/p01-contact. Specifically, copied the one titled "A big one:".
After removing all the extra space between the fields, the form appeared as expected. I can fill out and send the form as expected and get the message that the email was sent. I also actually receive the email. However, I'm left with several error messages at the top of the screen. Specifically...
Warning: Invalid argument supplied for foreach() in /usr/home/dblewett/public_html/tealacn/plugins/p01-contact/p01-contact.php on line 965
And the message repeats for lines 975 and 952. I haven't changed anything in that php file, or any other file. I also get this message if I'm in debug mode.
What is causing this?
Posts: 2,928
Threads: 195
Joined: Feb 2011
well, I think this is because the plugin is not updated for some time
my personal suggestion:
if you receive all the posts and everything else is ok, just ignore these messages
Posts: 10
Threads: 2
Joined: Apr 2013
(2013-04-11, 19:05:30)Connie Wrote: well, I think this is because the plugin is not updated for some time
my personal suggestion:
if you receive all the posts and everything else is ok, just ignore these messages
No, I don't think so. Imagine you're a customer on my site, I've just asked you to invest money or buy my products or hire me to build you a web site or any number of other scenarios. You fill out a contact form and are presented with this response...
Warning: Invalid argument supplied for foreach() in /usr/home/dblewett/public_html/tealacn/plugins/p01-contact/p01-contact.php on line 975
Warning: Invalid argument supplied for foreach() in /usr/home/dblewett/public_html/tealacn/plugins/p01-contact/p01-contact.php on line 965
Warning: Invalid argument supplied for foreach() in /usr/home/dblewett/public_html/tealacn/plugins/p01-contact/p01-contact.php on line 952
Yeah, that won't work.
Posts: 206
Threads: 7
Joined: Mar 2013
It works okay for me, did you try it even without your changes?
Try to do the changes again and control the form functionality after every important step.
Posts: 10
Threads: 2
Joined: Apr 2013
2013-04-12, 00:59:31
(This post was last modified: 2013-04-12, 01:11:40 by dblewett.)
(2013-04-12, 00:46:25)TeeJay Wrote: It works okay for me, did you try it even without your changes?
Try to do the changes again and control the form functionality after every important step.
The changes that I made are as follows.
The original text in the support document at http://nliautaud.fr/wiki/travaux/p01-contact shows
(% contact : address@domain.ext, another@domain.ext,
subject => About this script,
email!,
textarea "How old is born Napoléon?",
phone,
radio "Do you like this script?" = "Yes" selected | "No",
website,
select = "One" selected | "Two" | "Three" | "Four" | "Five" ,
message = Say something!,
password = tomato,
captcha,
askcopy %)
When I place that text exactly in my page and then view the page, it shows me that text printed on the page, no form. (I did change the email address)
I edited the text so that it looks like this.
(% contact : address@domain.ext, another@domain.ext, subject => About this script, email!, textarea "How old is born Napoléon?", phone, radio "Do you like this script?" = "Yes" selected | "No", website, select = "One" selected | "Two" | "Three" | "Four" | "Five" , message = Say something!, password = tomato, captcha, askcopy %)
All I did was delete all the extra spaces and line feeds. But I do like the potential of this form and will continue experimenting.
I should add this. If I simply put (% contact %) on my web page and put the select elements in the plugin's default parameters section of the settings page, I get the same results.
I should also add that if I create a form with no checkbox, select, or radio fields, then the form works perfect with no errors.
Posts: 206
Threads: 7
Joined: Mar 2013
2013-04-12, 07:15:09
(This post was last modified: 2013-04-15, 05:37:59 by TeeJay.)
@dblewett
Look,
Line 952 is a checkbox
Code: case 'checkbox' :
foreach($this->value as $i => $v) {
$value = !empty($v[1]) ? ' ' . $v[1] : '';
$selected = !empty($v[2]) && $v[2] == 'selected' ? ' checked' : '';
$html .= '
<input id="' . $id . '_option' . $i . '"';
$html .= ' type="checkbox" name="' . $name . '[' . $i . ']"';
$html .= ' value="' . $value . '"' . $disabled . $selected;
$html .= ' />' . $value;
}
break;
965 is a select
Code: case 'select' :
$html .= '
<select id="' . $id . '" name="' . $name . '"' . $disabled . '>';
foreach($this->value as $i => $v) {
$value = !empty($v[1]) ? ' ' . $v[1] : ' Default';
$selected = !empty($v[2]) && $v[2] == 'selected' ? 'selected="selected"' : '';
$html .= '
<option id="' . $id . '_option' . $i . '" value="' . $value;
$html .= '"' . $selected . ' >' . $value . '</option>';
}
$html.= '</select>';
break;
and 975 is a radio
Code: case 'radio' :
foreach($this->value as $i => $v) {
$value = !empty($v[1]) ? ' ' . $v[1] : ' Default';
$selected = !empty($v[2]) && $v[2] == 'selected' ? ' checked' : '';
$html .= '
<input id="' . $id . '_option' . $i . '" type="radio" ';
$html .= 'name="' . $name . '" value="' . $value . '"';
$html .= $disabled . $selected . ' />' . $value;
}
break;
Now you know what is causing the problem. Try the form without these extra fields, it should be ok.
But I don't know how to correct it with them, I don't know what's wrong, I'm not good at PHP at all.
Just to make sure, is it true that the errors are shown even if you don't delete the spaces?
Are you using the latest GS and the latest p01-contact?
(2013-04-12, 00:59:31)dblewett Wrote: I should also add that if I create a form with no checkbox, select, or radio fields, then the form works perfect with no errors. Sorry, as I explained above, I don't know why it doesn't work with these fields.
Posts: 1,928
Threads: 88
Joined: Apr 2010
add "askcopy" causes errors
Posts: 206
Threads: 7
Joined: Mar 2013
2013-04-18, 00:37:51
(This post was last modified: 2013-04-18, 00:41:29 by TeeJay.)
Well, I tried it and yeah it's wrong but I don't see what to do about it. We would need someone who understands the code well.
I attached an image with the form, the e-mail received and the error. The problem is only with the select, checkbox and radio - the askcopy works well, got both e-mails and no error.
So the only problem is the warning after sending the message which can be really disturbing and making the sender unsure if everything went well.
See the picture:
Posts: 1,928
Threads: 88
Joined: Apr 2010
2013-04-18, 00:42:19
(This post was last modified: 2015-02-20, 22:24:51 by Oleg06.)
works for me with no errors
Posts: 206
Threads: 7
Joined: Mar 2013
(2013-04-18, 00:42:19)Oleg06 Wrote: http://business-website.ru/shablony-dlya...3/?lang=ru
works for me with no errors Yeah, it really works. What version of the GetSimple are you using? What version of the p01-contact? And can you post the code of your ( % contact % ) ? Thank you.
Posts: 1,928
Threads: 88
Joined: Apr 2010
2013-04-18, 01:16:59
(This post was last modified: 2013-04-18, 01:18:30 by Oleg06.)
GS version 3.1.2? p01-contact version 0.9.1
Code: (% contact :text! "Ã’ðшõ øüÑÂ", email!, subject! ×ðúð÷ ÑÂðùтð, text! "№ шðñûþýð" {%page-slug%}, radio "Òыñõрøтõ цòõт" = "áøýøù" selected | "áõрыù" | "×õûõýыù" | "ÚрðÑÂýыù" | "Ôруóþù", text "ãúðöøтõ цòõт - #000000",select "ßрøüõрýþõ úþûøчõÑÂтòþ ÑÂтрðýøц" = "5" selected | "6 - 10" | "ñþûõõ 10" | "ñþûõõ 20" | "ñþûõõ 30" , checkbox "Ôþÿþûýøтõûьýыõ ÿûðóøýы"="ÞÿрþÑÂы" | "Þт÷ыòы" | "çðÑÂтыõ òþÿрþÑÂы" | "áþцøðûьýыõ ÑÂõтø", message! "Ã’ðшø ÿþöõûðýøÑÂ", captcha %)
After I added the "askcopy" errors appear
Posts: 206
Threads: 7
Joined: Mar 2013
2013-04-18, 02:27:07
(This post was last modified: 2013-04-18, 02:29:45 by TeeJay.)
(2013-04-18, 01:16:59)Oleg06 Wrote: GS version 3.1.2? p01-contact version 0.9.1
Code: (% contact :text! "Ã’ðшõ øüÑÂ", email!, subject! ×ðúð÷ ÑÂðùтð, text! "№ шðñûþýð" {%page-slug%}, radio "Òыñõрøтõ цòõт" = "áøýøù" selected | "áõрыù" | "×õûõýыù" | "ÚрðÑÂýыù" | "Ôруóþù", text "ãúðöøтõ цòõт - #000000",select "ßрøüõрýþõ úþûøчõÑÂтòþ ÑÂтрðýøц" = "5" selected | "6 - 10" | "ñþûõõ 10" | "ñþûõõ 20" | "ñþûõõ 30" , checkbox "Ôþÿþûýøтõûьýыõ ÿûðóøýы"="ÞÿрþÑÂы" | "Þт÷ыòы" | "çðÑÂтыõ òþÿрþÑÂы" | "áþцøðûьýыõ ÑÂõтø", message! "Ã’ðшø ÿþöõûðýøÑÂ", captcha %)
After I added the "askcopy" errors appear
That is a great finding. It really works if not using the "askcopy", so we can make it work properly without any problems. I don't think that askcopy is something important. Most internet forms are without it
Thank you Oleg06.
|