Page 1 of 1

Unwanted text at top of page

Posted: Fri Jul 11, 2014 9:21 pm
by jimbob
Managed to finally upload the website. However on the page with a data capture form I have loads of unwanted text at the top of the page (see below) - what have I done wrong?? :shock:


"; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "send", "captcha_code"); $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 && $_FILES[$key]['size'] <= $max_filesize) { $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); exit; } ?>

Re: Unwanted text at top of page

Posted: Sat Jul 12, 2014 6:32 am
by Pablo
This is the form processor script.
If this code appears on the top of the page then you either have not published the page to a web server or the extension of the page is not set to PHP.

Related FAQ:
http://www.quickandeasywebbuilder.com/f ... 10&t=32967

Re: Unwanted text at top of page

Posted: Tue Sep 22, 2015 5:25 pm
by fillbert
I am having the same problem. I have published to a website and have changed the page extension to php. I created a comments form using the wizard. Just for grins, I tried some other forms - they work ok. It's only the comment, contact 1, and contact 2 that are not working.

Here is the web site: www.websitepc2.net.

Also, there appears to be a bug in the forms area. If I create a form, say comments, then delete it and create a different form, after publishing, the original comments form is still the one that gets is displayed, not the new form.

PC

Re: Unwanted text at top of page

Posted: Tue Sep 22, 2015 6:39 pm
by fillbert
I figured out the problem with the code showing up at the top of my page - I had to rename index.htm on my web server. However, now that the form looks like it is working ok, still not getting any comments submitted to my email address. Somewhere in your documentation, I recall reading that mailto: should not be used. However, I see that mailto: is used in the code generated by the comments form wizard. Is there a way around this?

Thx

PC

www.websitepc2.net

Re: Unwanted text at top of page

Posted: Tue Sep 22, 2015 8:22 pm
by Pablo
Did you read 'Emails are not arriving in my inbox' in the FAQ?
http://www.quickandeasywebbuilder.com/f ... 10&t=32967

Note: your form is not using 'mailto'

Re: Unwanted text at top of page

Posted: Tue Sep 22, 2015 9:04 pm
by fillbert
Thanks for the clarification. As I read thru the FAQs, I see the reference to Godaddy, which is what I am using to host my website. So, given that, it would seem that is why I am not getting any emails via my form.

Actually, the only reason I am using the comment form at all is that I will be converting over an existing website that has a place where running comments can be entered, kind of like a forum. I'd like to be able to continue to use this feature, but I can't figure out how I can make this happen within QnE. I looked for snippet of code that I can copy and paste, but I can't get any of them to work. :(

PC

Re: Unwanted text at top of page

Posted: Tue Sep 22, 2015 9:08 pm
by Pablo
A forum is a script that you need to install on the server.
After you have installed it, you can integrate it with your website.

Related FAQ about Godaddy forms:
viewtopic.php?f=10&t=42495