contact form

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

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: 2393
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: 7
Joined: Mon Apr 17, 2017 3:36 pm
Location: Oregon, USA

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: 446
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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests