Email Form

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
sporto
Posts: 160
Joined: Mon 10. Nov 2003, 18:01
Location: USA, Chicago

Email Form

Post by sporto »

When I try to create an email form in the admin, I get this feedback in the text box:

"<b>Warning</b>: htmlentities() expects parameter 1 to be string, array given in <b>/home/hsc/public_html/_cms/subsub/include/inc_tmpl/content/cnt10.inc.php</b> on line <b>53</b><br />"

Any thoughts?
User avatar
Oliver Georgi
Site Admin
Posts: 9906
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

OK found the mistake - only happens if no form field created an error happens that prevents the script to update the db entry -> then form field is an array -> fixed:

in "article.readform.inc.php" line 375 add:

Code: Select all

        } else {
			$content["mailform"] = "";
		}
The complete if() part (line 367-376):

Code: Select all

        if (count($content["mailform"])) {
            $content["form"] = "";
            $mft = 0;
            foreach($content["mailform"] as $key => $value) {
                $content["form"] .= (($mft) ? "\n" : "") . $content["mailform"][$key]["field"];
                $mft++;
            } 
        } else {
			$content["mailform"] = "";
		}
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
sporto
Posts: 160
Joined: Mon 10. Nov 2003, 18:01
Location: USA, Chicago

Post by sporto »

I made the change mentioned above (is it included in one of the patches>) but it's still not working for me. I'm not getting the error message, but noting is appearing. Maybe I'm just using this wrong.

Is the email form meant to create forms on the page?
User avatar
Oliver Georgi
Site Admin
Posts: 9906
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

No it's not in a patch (I have forgotten).

You have to fill in some values - check the form info red error message!!!!

It creates forms frontend.


Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
sporto
Posts: 160
Joined: Mon 10. Nov 2003, 18:01
Location: USA, Chicago

Post by sporto »

I don't get any red errors. I just get nothing. It blanks out my text box each time and doesn't add anything. :?:
User avatar
Oliver Georgi
Site Admin
Posts: 9906
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Test this here in the textarea - try to fill in all other fields

Code: Select all

IT|vorname|1|Vorname:&nbsp;|40,100|wert|300
IP|passwort|0|Passwort:&nbsp;|12,100||100
TA|info|0|Info:&nbsp;|20,3||300
SM|menu|0|Menü:&nbsp;|20,100|Test#Test2#Test3|300
SL|list|0|Liste:&nbsp;|3,0|1%Test#2%Test2#3%Test3#4%Test4|200
IC|mark|1|Markierung:&nbsp;|50,3|mark1%1%DU#mark2#mark3#Liste#Neu#Auswahl|0
IR|radio|1|Wählen:&nbsp;|50,0|mark1%1%DU#mark2#mark3|0
SC|country|0|Land:&nbsp;|10,100|FR|300
IN|plz|1|PLZ:&nbsp;|40,100||300
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
sporto
Posts: 160
Joined: Mon 10. Nov 2003, 18:01
Location: USA, Chicago

Post by sporto »

It works. Great. Thanks.

One question... The form takes you to a formmailer page which is in German and is not part of the templated system. Is there a way for it to take you to a basic thank you page? Is there a thank you tag to include in the form field?
User avatar
Oliver Georgi
Site Admin
Posts: 9906
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

The formmailer itself is prepared for such thing - I would rework the formmailer in the way that it is itegrated in the frontend script with also redirection to thank you page.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply