Possible solutions of your questions

  hosting
<< Previous       Stopped working script

Question: Hello! For many years I use your hosting, and in particular your php script. But today I noticed that he ceased to appear on all my projects. Just a blank window. What changes I never made. Ie just stopped working without any reason. Here`s the address: http://www.jesuswidget.vsevolod-pankratov.com/contacts.phpError_log writes:[05-Feb-2014 14:20:45 Europe/Moscow] PHP Fatal error: Cannot redeclare quoted_printable_encode() in /home/sewak/JesusWidget/contacts.php 108Хотя on line 108 the line is just a closing brace }Here the script code:is Not filled in field \"name\"`; if ( !empty( $name ) and preg_match(\"/[^(\\w)|(\\x7F-\\xFF)|(\\s)]/\",$name) ) $error = $error.`
  • the field \"name\" filled in incorrectly
  • `; if ( !empty( $sitename ) and preg_match(\"/[^(\\w)|(\\x7F-\\xFF)|(\\s)]/\",$sitename) ) $error = $error.`
  • the \"Subject\" field is filled in incorrectly
  • `; if ( empty( $message ) ) $error = $error.`
  • please enter Message
  • `; if ( empty( $email ) ) $error = $error.`
  • filled field \"E-mail\"
  • `; if ( !empty( $email ) and !preg_match( \"#^[0-9a-z_\\-\\.]+@[0-9a-z\\-\\.]+\\.[a-z]{2,6}$#i\", $email ) ) $error = $error.`
  • the field \"e-mail\" should follow the format NEMAIL
  • `; if ( !empty( $error ) ) { $_SESSION[`sendMailForm`][`error`] = `

    When sending messages, mistakes were made:

      `.$error.`
    `; $_SESSION[`sendMailForm`][`name`] = $name; $_SESSION[`sendMailForm`][`sitename`] = $sitename; $_SESSION[`sendMailForm`][`description`] = $description; $_SESSION[`sendMailForm`][`email`] = $email; $_SESSION[`sendMailForm`][`subject`] = $subject; $_SESSION[`sendMailForm`][`message`] = $message; header( `Location: `.$_SERVER[`PHP_SELF`] ); die(); } $filepath = array(); $filename = array(); for( $i = 0; $i < count($_FILES[`file`]); $i++) { if ( !empty( $_FILES[`file`][`tmp_name`][$i] ) and $_FILES[`file`][`error`][$i] == 0 ) { $filepath[] = $_FILES[`file`][`tmp_name`][$i]; $filename[] = $_FILES[`file`][`name`][$i]; } } $body = \"Writes:\\r\\n\".$name.\"\\r\\n\\r\\n\"; $body .= \"Subject:\\r\\n\".$sitename.\"\\r\\n\\r\\n\"; $body .= \"e-mail:\\r\\n\".$email.\"\\r\\n\\r\\n\"; $body .= \"Message:\\r\\n\".$message; if ( send_mail($admin, $body, $email, $filepath, $filename) ) $_SESSION[`success`] = true; else $_SESSION[`success`] = false; header( `Location: `.$_SERVER[`PHP_SELF`] ); die();}function send_mail($admin, $body, $email, $filepath, $filename){ $subject = `=?utf-8?B?`.base64_encode(`a Letter from the official website VI\"`).`?=`; $boundary = \"--\".md5(uniqid(time())); $headers = \"Content-type: text/html; charset=utf-8 \\r\\n\"; $headers = \"From: \".strtoupper($_SERVER[`SERVER_NAME`]).\" <\".$email.\">\\r\\n\"; $headers .= \"Return-path: <\".$email.\">\\r\\n\"; $headers .= \"MIME-Version: 1.0\\r\\n\"; $headers .=\"Content-Type: multipart/mixed; boundary=\\\"\".$boundary.\"\\\"\\r\\n\"; $multipart = \"--\".$boundary.\"\\r\\n\"; $multipart .= \"Content-type: text/plain; charset=\\\"utf-8\\\"\\r\\n\"; $multipart .= \"Content-Transfer-Encoding: quoted-printable\\r\\n\\r\\n\"; $body = quoted_printable_encode( $body ).\"\\r\\n\\r\\n\"; $multipart .= $body; $file = \"; $count = count( $filepath ); if ( $count > 0 ) { for ( $i = 0; $i < $count; $i++ ) { $fp = fopen($filepath[$i], \"r\"); if ( $fp ) { $content = fread($fp, filesize($filepath[$i])); fclose($fp); $file .= \"--\".$boundary.\"\\r\\n\"; $file .= \"Content-Type: application/octet-stream\\r\\n\"; $file .= \"Content-Transfer-Encoding: base64\\r\\n\"; $file .= \"Content-Disposition: attachment; filename=\\\"\".$filename[$i].\"\\\"\\r\\n\\r\\n\"; $file .= chunk_split(base64_encode($content)).\"\\r\\n\"; } } } $multipart .= $file.\"--\".$boundary.\"--\\r\\n\"; if( mail($admin, $subject, $multipart, $headers) ) return true; else return false;}function quoted_printable_encode ( $string ) { // rule #2, #3 (leaves space and tab characters in tact) $string = preg_replace_callback ( `/[^\\x21-\\x3C\\x3E-\\x7E\\x09\\x20]/`, `quoted_printable_encode_character`, $string ); $newline = \"=\\r\\n\"; // `=` + CRLF (rule #4) // make sure the splitting of lines does not interfere with escaped characters // (chunk_split fails here) $string = preg_replace ( `/(.{73}[^=]{0,3})/`, `$1`.$newline, $string); return $string;}function quoted_printable_encode_character ( $matches ) { $character = $matches[0]; return sprintf ( `=%02x`, ord ( $character ) );}?>Contacts
    Your message was successfully sent! Within 24 hours we will reply to you.
    Blessings!

    `; else echo `

    Error sending message!

    `; unset( $_SESSION[`success`] );}?>
    \" method=\"POST\" enctype=\"multipart/form-data\">
    Please identify:\" />
    Subject:\" />
    Contact e-mail:\" />
    Message:
     
    Answer:

    Hello. are you using register globals?

    Question: Solved the problem by using the line:if (!function_exists(`quoted_printable_encode`)) {and then the code goes:function quoted_printable_encode ( $string) {....}}Have you updated PHP version, right?
    Answer:

    no , we have not updated the version of php you available any version RRV control panel, select php

    Question: Wow. Thanks, didn`t know. Put version 5.5! :)
    Answer:

    but it`s nothing... put no higher 5.4  still raw 5.5

    Question: Eugene, thank you very much! Yes, indeed, glad and put 5.5. In the end some scripts on my sites ceased to function. 5.4 at the time!
    Answer:


    ok


    << Previous