contact form

Issues related to forms.
Post Reply
tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

contact form

Post by tubenirvana » Mon May 01, 2017 10:38 pm

I am trying to create a contact form, where a user has to enter their name, e-mail address and fill out a field with their inquiry.
All fields MUST be filled out in order to send this form.
How do I create such a form, thank you.

User avatar
Pablo
Site Admin
Posts: 2599
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: contact form

Post by Pablo » Tue May 02, 2017 6:38 am


tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

Re: contact form

Post by tubenirvana » Thu May 04, 2017 11:05 pm

thank you.
However, when I do a preview of the page, I get all these lines on the top of the browser.

"; } 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", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response"); $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; } ?>

mexman
Posts: 485
Joined: Mon Feb 11, 2013 11:33 am
Location: Puebla/Mexico

Re: contact form

Post by mexman » Thu May 04, 2017 11:51 pm

Hi tubenirvana:
That is PHP code. If you can see THAT on a published page, you did not use the file extension .PHP but .HTML. When you see that while in PREVIEW, that is normal: A PHP code can only run in the server side, not in preview. If you don't WANT to see that code, please go to
TOOLS-PREFERENCES-PUBLISH and tick "REMOVE PHP CODE IN PREVIEW"
Regards
Michael

tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

Re: contact form

Post by tubenirvana » Sun Jun 18, 2017 8:38 pm

finally had a chance to change the extension to PHP, but all that coding is still showing up on the browser.
Please look here, http://erhard-audio.com/Contact.html, thanks. Even though I changed the extension to PHP in the editor, it still comes up as .HTML. I have uploaded the correct file extension and refreshed my browser, still no good.
I should also add that it does not even come up under Preview.

betwixt
Posts: 12
Joined: Mon Nov 25, 2013 3:49 pm

Re: contact form

Post by betwixt » Sun Jun 18, 2017 10:27 pm

My guess is you didn't remove the HTML version from the server so it is still there along with the newly published PHP version.
When seeing both names, your browser will have a preference of one over the other so it is still showing the original HTML version.

If it's there, delete contact.html so only the contact.php remains.

Brian.

tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

Re: contact form

Post by tubenirvana » Mon Jun 19, 2017 1:07 am

OK, thanks for that. Yes, the HTML file was still there.
So I just tried it out, and when I click on send, a new e-mail window opens up in my mail program

In the text area, this is visible -

formid=form2
name=Holger Schaarschmidt
email=erhard58@gmail.com
Editbox3=test

in the 'To' flied, this is in 'yourname@yourdomain.com'

When I created this contact form using the form wizard, I put my e-mail address in, as well as adding a 'message' field, and apart from making each field a bit bigger, I did not add or change anything else, here is the link http://www.erhard-audio.com/Contact.php

This is quite frustrating.

User avatar
Pablo
Site Admin
Posts: 2599
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: contact form

Post by Pablo » Mon Jun 19, 2017 5:44 am

Your page has two forms. For one of them, the form's action is set to 'mailto', so the browser will use the default email client to send the email.
Please only use one form per page and enable the built-in form processor script.

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

tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

Re: contact form

Post by tubenirvana » Mon Jun 19, 2017 4:05 pm

Hi Pablo,

thanks for that. I don't quite understand what you mean by that page having two forms? I actually re-did the contact page from scratch yesterday, by deleting the old form and recreating a new one, and still had the same issue.
I will check the page again and see what's happening.

User avatar
Pablo
Site Admin
Posts: 2599
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: contact form

Post by Pablo » Mon Jun 19, 2017 5:19 pm

It looks like it is fixed now.

tubenirvana
Posts: 22
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA
Contact:

Re: contact form

Post by tubenirvana » Mon Jun 19, 2017 6:06 pm

yes, got it all up and running, thank you for your help.

Also, in your 'help' instructions, you mention that Go Daddy does not support PHP, they do now, as it is Go Daddy that I use.
Again, thanks for your help!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests