Publishing Forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • B1uenose
    Special Status

    • Apr 2008
    • 28

    Publishing Forms

    I have only been uploading pages via BV, via my VH account. I thought that when you uploaded a page with a form on it, it would end up being saved as a .php page. But, I am trying to do that and it is being saved as a .html page. It has now sort of uploaded, but all the following is showing at the top of the page. Please help if you can figure out what i am doing wrong. I am going to play again tonight, but dont see how I get the account to recognise it as form page. I did have it working properly, but with a new page now, it seems to have gone a bit pete tong.


    "; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "filesize", "upload_folder", "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; mail($mailto, $subject, $body, $header); header('Location: '.$success_url); exit; } ?>

  • B1uenose
    Special Status

    • Apr 2008
    • 28

    #2
    Re: Publishing Forms

    Hi, I have searched the forums and cant find an answer to this. I just watched the tutorial again and it simply tells you to save a form page as normal, and that a page containing a form will publish as a php page instead of a html page, automatically, But thats not happening for some reason.

    The site is here www.nisus-training.co.uk and the only 2 live pages at the mo are the index and the contact us. I am sure it will be obvious to someone what has happened here or what i am doing wrong.

    Comment

    • Vasili
      Moderator

      • Mar 2006
      • 14683

      #3
      Re: Publishing Forms

      You are not following the Tutorial precisely, as it clearly emphasizes the importance of selecting in FORM PROPERTIES (reveal Form Properties by double-clicking on Form Area) under FORM PROCESSING the option "Use built-in PHP processor to send the data to an email address" .... this will change the manner in which the page is published by resetting the page extension, specifically to a ".php" page and not a ".html" page that you have been publishing (and the reason the PHP script is both not functional and displaying ON the page instead as PART OF THE PAGE CODE).
      . VodaWebs....Luxury Group
      * Success Is Potential Realized *

      Comment

      Working...
      X