Form not working in WB12

Issues related to forms.
Post Reply
User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Form not working in WB12

Post by DarrenH » Fri Oct 27, 2017 6:51 pm

Hi

I have created a site in WB12 using "blocks".

My server supports PHP Version 5.6.31

When I build the site with blocks, and use a "form block", I publish the index.php file, and get this error message.

Parse error: syntax error, unexpected '{' in /home/dmhconce/public_html/index.php on line 68

I have enabled the tick box on the contact block that I dragged into place, and also use the built in form processor.

Not sure where it's going wrong, as I never had the same trouble with WB9, 10?

Any ideas please?

Thank you

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Fri Oct 27, 2017 7:51 pm

This error indicates that there is an error in your settings.
Please share your project so I can see what you have done.

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Fri Oct 27, 2017 8:06 pm

Thank you Pablo.

How do I send you the file? Where to?

Thanks

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Fri Oct 27, 2017 8:50 pm

1. Upload the file to your website or another public server
2. Share the link

Before you share your project, please remove all custom code, extensions and other non-relevant content.

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Fri Oct 27, 2017 9:04 pm

Thank you Pablo.

I have removed the videos to ensure the file is small.

I haven't inserted any custom code - only WB native elements.

You can download the zip here:

http://www.dmhconcepts.co.uk/pablo/

Thanks

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Sat Oct 28, 2017 7:14 am

Thanks for sharing the project file.
However I do not see any problems in the code.

What does the PHP code look like for you?
What code is on line 68?

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Sat Oct 28, 2017 10:16 am

Hi Pablo

The only code on line 68 is {

This is the code - from line 68 to line 75, the closing }

{
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;
}
}

Thanks

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Sat Oct 28, 2017 10:32 am

This code is not complete.
Did you manually edit the code?
Are you using the latest update (12.2.2)?

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Sat Oct 28, 2017 10:37 am

Thanks Pablo

No, I haven't manually altered or added any code.

I am using version 12.0.

I will upgrade to the latest version and see if that alters anything.

Thank you

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Sat Oct 28, 2017 10:51 am

Hi Pablo

I have downloaded the latest version, and republished.

However, the text is all missing from the beginning of the website, and the formatting of the newly created form is incorrect, so I am unable to test the form.

Can you help please?

Thank you

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Sat Oct 28, 2017 11:26 am

Did you publish all files?
What is the URL of the page?
And where exactly do I need to look to see the problem?

User avatar
DarrenH
 
 
Posts: 105
Joined: Thu Apr 10, 2008 9:31 am

Re: Form not working in WB12

Post by DarrenH » Sat Oct 28, 2017 11:54 am

Sorry Pablo, my bad, I hadn't published all files.

However

I have now published and tested the form and I am not receiving anything.
Please could you help on this.

http://www.dmhconcepts.co.uk/darren/

Just so I could see if it is the form on the site I have built in WB12, I have built a separate form for testing in WB9, published that on the same server in a different directory, and receive that information straight away.

Thanks

User avatar
Pablo
 
Posts: 19655
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form not working in WB12

Post by Pablo » Sat Oct 28, 2017 2:05 pm

Did you read the FAQ?
viewtopic.php?f=10&t=32967
(Emails are not arriving in my inbox...)

Note that this has nothing to do with WB12. Emails are sent by the server, not by the software.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests