Email Popup Form

Issues related to forms.
Post Reply
pboyer
 
 
Posts: 4
Joined: Thu Mar 05, 2020 7:10 pm

Email Popup Form

Post by pboyer »

Image

Hi, I'm trying to configure an email popup form.
I get all that stuff on top of the page (php error in the image)
All I want is the form to send an email with the informations filled in the boxes to my email address.
What am I doing wrong?
In case you can't see the picture here's the error message.
"; throw new Exception($error); } $message .= $eol; $message .= "IP Address : "; $message .= $_SERVER['REMOTE_ADDR']; $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (!is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol; if ($mailto != '') { mail($mailto, $subject, $body, $header); } header('Location: '.$success_url); } catch (Exception $e) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $e->getMessage(), $errorcode); echo $errorcode; } exit; } ?>
User avatar
BaconFries
 
 
Posts: 5369
Joined: Thu Aug 16, 2007 7:32 pm

Re: Email Popup Form

Post by BaconFries »

When you use a form you need to set the page extension to be .php Also note you are required to publish to your host / server which needs to support php before it will work.
User avatar
Pablo
 
Posts: 21716
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Email Popup Form

Post by Pablo »

See also the FAQ:
viewtopic.php?f=10&t=32967
pboyer
 
 
Posts: 4
Joined: Thu Mar 05, 2020 7:10 pm

Re: Email Popup Form

Post by pboyer »

Look I tried everything and it still doesn't work.
pbi.visionkbe.com is the website. The only way to avoid the error message on the top is to set it so it opens Outlook instead of sending the mail through php. pbi.visionkbe.com/test.php is a test I did to check which version my host has and it's 7.3. What am I doing wrong.
Could you send me clear instructions or an example?
GrahamW
 
 
Posts: 240
Joined: Sat Jul 08, 2017 5:02 am

Re: Email Popup Form

Post by GrahamW »

maybe my html email will help you.

you can see it here and do a demo
https://shop.grahamscomputers.net/websh ... ail-7.html
when you set you page up in WB it can have any extension you like eg: .htm, .html or .php I normally set mine to .html

You just build your site as per normal and add the extension to the site and fill in the address you want it to go etc and also set the html layout for the message and autoresponder and your good to go.

Your server must support PHP though for it to work.

Graham
User avatar
BaconFries
 
 
Posts: 5369
Joined: Thu Aug 16, 2007 7:32 pm

Re: Email Popup Form

Post by BaconFries »

This is what I get when I try to view your site

Image

To be able to help you what are your settings used in the form? Did you read all the information in the url Pablo provided?
Reading from:
Why shouldn't I use 'mailto' in the form action?
I have a problem which is not covered in the help, tutorials or FAQ, can you help?
viewtopic.php?f=10&t=32967
Perhaps your host requires you to use SMTP? please check with them if this is a requirement.
pboyer
 
 
Posts: 4
Joined: Thu Mar 05, 2020 7:10 pm

Re: Email Popup Form

Post by pboyer »

I managed to make it work.... kinda.
When I use my masterframe which has a popup form, a header and a footer.
My pages doesn't show up.

I tried making a dummy masterframe from a blank page with only a popup mail form, header and a footer.
I made a page with only text and another I copied a picture from the pages that already exist.

It works with the text only page. I get the email with all the infos.
It doesn't with the copied content. The popup button is white and doesn't react to clicks.


This is how my master frame is made.
https://ibb.co/pywP2xC

This is the page with a picture in it.
In Wysiwyg
https://ibb.co/R6j2JKd
Result
https://ibb.co/ctnVZSd

This is the page with only text in it.
In Wysiwyg
https://ibb.co/1fD28tm
Result
https://ibb.co/1bCwj2c

This is how my popup form is configured. (I have removed my email for privacy)
https://ibb.co/MCLc19t
User avatar
Pablo
 
Posts: 21716
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Email Popup Form

Post by Pablo »

To be able to help you , I need a demo project so I can see all the settings.
Note that I do not need your complete project, only a simple projetc which demonstrate what you are trying to do.

Related FAQ:
https://www.wysiwygwebbuilder.com/forum ... 10&t=82134
pboyer
 
 
Posts: 4
Joined: Thu Mar 05, 2020 7:10 pm

Re: Email Popup Form

Post by pboyer »

WBS file https://we.tl/t-t4ol6v2buN

I used MasterFrameGold on the page testindex.
This is the result.
http://pbi.visionkbe.com/test/testindexMFG.php
User avatar
Pablo
 
Posts: 21716
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Email Popup Form

Post by Pablo »

You have added several breadcrumb menus (Breadcrumb3, Breadcrumb4, Breadcrumb6) which are is configured to connect to a CMS database.
However, the page does not have a CMS view!

I suggest to cleanup the page and remove all obsolete or/and duplicated objects.
Post Reply