SMF HELP! SMF.org
*
Welcome! Guest. Please Login Or Register

Last News: Zapraszam na Polish Suport Simple Machines Forum www.smf.pl  big_boss
advanced  
  HOME   FORUM   CHAT HELP SEARCH GALLERY LOGIN REGISTER  
  Strony: [1]   Bottom Do dołu
  Drukuj  
ico Autor    
[EN] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [RU]
      Topic: Formularz kontaktowy nie wysy?a wiadomo?ci  [Przeczytany 47248 razy]
0 użytkowników i 1 Gość przegląda ten wątek.
8: Array to string conversion
Plik: /home/roco/sites/roco/www/ricoroco/poligon/fora/smf/Sources/Subs.php
Linia: 2466
Global Moder
*****
Mi?o?niczka psów
La Toma Magic
Offline
03.02.2017 22:19:11
Topic Starter
 Poland Kobieta
Poland
  WWW
DATA: [10.07.2010 21:23:16]Formularz kontaktowy nie wysy?a wiadomo?ci
Link:  http://poligon.ricoroco.com/fora/smf/index.php?topic=1561.msg2822#msg2822  
Witam,

Zainstalowa?am Advanced contact form i mam perien problem: zg?asza b??d mimo poprawnie wpisanego adresu e-mail, nie umiem znale?? b??du w skrypcie Smutny

Code: [select]
<?php
/**********************************************************************************
* Contact.php                                                                     *
***********************************************************************************
*                                                                                 *
* Execution file for "Contact Form" modification.                                 *
*                                                                                 *
* Copyright (c) 2008 by Deprecated (at) Earthlink (dot) net. All rights reserved. *
* Redistribution prohibited except at SimpleMachines.org                          *
*                                                                                 *
**********************************************************************************/

if (!defined(&#39;SMF&#39;))
die(&#39;Hacking attempt...&#39;);

function Contact()
{
global $context, $settings, $options, $scripturl, $boarddir, $sourcedir, $modSettings, $user_info, $txt, $webmaster_email;

if($user_info[&#39;is_guest&#39;] && empty($modSettings[&#39;contact_form_enable_guest_access&#39;])) redirectexit();
if(!$user_info[&#39;is_guest&#39;] && empty($modSettings[&#39;contact_form_enable_member_access&#39;])) redirectexit();

$global_error = false;

if (!empty($modSettings[&#39;reg_verification&#39;]) && $context[&#39;user&#39;][&#39;is_guest&#39;])
{
require_once($sourcedir . &#39;/Subs-Editor.php&#39;);
$verificationOptions = array(
&#39;id&#39; => &#39;register&#39;,
);
if (isset($_POST[&#39;submit&#39;]))
{
$context[&#39;visual_verification&#39;] = create_control_verification($verificationOptions, true);
if (is_array($context[&#39;visual_verification&#39;]))
{
loadLanguage(&#39;Errors&#39;);
foreach ($context[&#39;visual_verification&#39;] as $error)
{
$global_error = $context[&#39;contact_form_error_visual_verification&#39;] = true;
$context[&#39;visual_verification_error_dscr&#39;] = $txt[&#39;error_&#39; . $error];
}
}
}
$context[&#39;visual_verification&#39;] = create_control_verification($verificationOptions);
$context[&#39;visual_verification_id&#39;] = $verificationOptions[&#39;id&#39;];
}
else $context[&#39;visual_verification&#39;] = false;

$content = &#39;&#39;;
$sender_ip = $_SERVER[&#39;REMOTE_ADDR&#39;];
$sender_rdns = gethostbyaddr($sender_ip);
if ($context[&#39;user&#39;][&#39;is_guest&#39;]) $sender = $txt[&#39;contact_form_sender_is_guest&#39;];
else
{
$sender = $context[&#39;user&#39;][&#39;name&#39;];
if ($context[&#39;user&#39;][&#39;name&#39;] != $context[&#39;user&#39;][&#39;username&#39;]) $sender .= &#39; (&#39; . $context[&#39;user&#39;][&#39;username&#39;] . &#39;)&#39;;
}

$message  = isset($_POST[&#39;message&#39;]) ? trim($_POST[&#39;message&#39;]) : &#39;&#39;;
if (!$message) $global_error = $context[&#39;contact_form_error_no_message&#39;] = true;

$sender_name = isset($_POST[&#39;name&#39;]) ? trim($_POST[&#39;name&#39;]) : &#39;&#39;;
if (!$sender_name && !empty($modSettings[&#39;contact_form_require_name&#39;])) $global_error = $context[&#39;contact_form_error_no_name&#39;] = true;
if (!$sender_name || !empty($modSettings[&#39;contact_form_sender_name_dont_use_form&#39;]))
{
$name = empty($modSettings[&#39;contact_form_default_name&#39;]) ? $txt[&#39;contact_form_default_name_default&#39;] : $modSettings[&#39;contact_form_default_name&#39;];
if ($sender_name) $content .= $txt[&#39;contact_form_label_status_name&#39;] . $sender_name . &#39;
&#39;;
}
else $name = $sender_name;

$sender_email = isset($_POST[&#39;email&#39;]) ? trim($_POST[&#39;email&#39;]) : &#39;&#39;;
if (!$sender_email && !empty($modSettings[&#39;contact_form_require_email&#39;])) $global_error = $context[&#39;contact_form_error_no_email&#39;] = true;
if ($sender_email && !valid_email($sender_email)) $global_error = $context[&#39;contact_form_error_invalid_email&#39;] = true;
if (!$sender_email || !empty($modSettings[&#39;contact_form_sender_email_dont_use_form&#39;]))
{
$email = empty($modSettings[&#39;contact_form_default_email_sender&#39;]) ? $webmaster_email : $modSettings[&#39;contact_form_default_email_sender&#39;];
if ($sender_email) $content .= $txt[&#39;contact_form_label_status_email&#39;] . $sender_email . &#39;
&#39;;
}
else $email = $sender_email;
$headers = &#39;From: &#39; . $name . &#39; <&#39; . $email . &#39;>&#39;;

$sender_subject = isset($_POST[&#39;subject&#39;]) ? trim($_POST[&#39;subject&#39;]) : &#39;&#39;;
if (!$sender_subject && !empty($modSettings[&#39;contact_form_require_subject&#39;])) $global_error = $context[&#39;contact_form_error_no_subject&#39;] = true;
if (!$sender_subject || !empty($modSettings[&#39;contact_form_sender_subject_dont_use_form&#39;]))
{
$subject = empty($modSettings[&#39;contact_form_default_subject&#39;]) ? $txt[&#39;contact_form_default_subject_default&#39;] : $modSettings[&#39;contact_form_default_subject&#39;];
if ($sender_subject) $content .= $txt[&#39;contact_form_label_status_subject&#39;]  . $sender_subject . &#39;
&#39;;
}
else $subject = $sender_subject;
if (!empty($modSettings[&#39;contact_form_subject_prefix&#39;])) $subject = $modSettings[&#39;contact_form_subject_prefix&#39;] . &#39; &#39; . $subject;

if ($content) $content .= $txt[&#39;contact_form_label_status_separator&#39;];

$content .= stripslashes($message);
$content .= $txt[&#39;contact_form_label_ip&#39;] . $sender_ip . $txt[&#39;contact_form_label_rdns&#39;] . $sender_rdns . $txt[&#39;contact_form_label_sender&#39;] . $sender;

$dest_email_addr = empty($modSettings[&#39;contact_form_dest_email_addr&#39;]) ? $webmaster_email : $modSettings[&#39;contact_form_dest_email_addr&#39;];

$context[&#39;page_title&#39;] = empty($modSettings[&#39;contact_form_display_title&#39;]) ? $txt[&#39;contact_form_title&#39;] : $modSettings[&#39;contact_form_display_title&#39;];

if (!$global_error && isset($_POST[&#39;submit&#39;]))
{
require_once($sourcedir . &#39;/Subs-Post.php&#39;);
$context[&#39;contact_form_sendmail_override_headers&#39;] = true;
if (sendmail($dest_email_addr, $subject, $content, $headers))
{
$context[&#39;contact_form_message_sent&#39;] = true;
$context[&#39;page_title&#39;] .= &#39; - &#39; . $txt[&#39;contact_form_result_message_sent&#39;];
}
else
{
$context[&#39;contact_form_message_failed&#39;] = true;
$context[&#39;page_title&#39;] .= &#39; - &#39; . $txt[&#39;contact_form_result_send_mail_failed&#39;];
}
}
else
{
if ($global_error && isset($_POST[&#39;submit&#39;]))
$context[&#39;page_title&#39;] .= &#39; - &#39; . $txt[&#39;contact_form_result_error&#39;];
}

$context[&#39;linktree&#39;][] = array(
&#39;url&#39; => $scripturl.&#39;?action=contact&#39;,
&#39;name&#39; => $context[&#39;page_title&#39;],
);

loadTemplate(&#39;Contact&#39;);
}

function 
valid_email($email)
{
global $modSettings;

$at_ptr = strrpos($email, "@");
if (is_bool($at_ptr) && !$at_ptr) return false;
$domain = substr($email, $at_ptr+1);
$local = substr($email, 0, $at_ptr);
$local_len = strlen($local);
$domain_len = strlen($domain);
if ($local_len < 1 || $local_len > 64 || $domain_len < 1 || $domain_len > 255) return false; // local or domain part length invalid
else if ($local[0] == &#39;.&#39; || $local[$local_len-1] == &#39;.&#39;) return false; // local part cannot start or end with dot
else if (preg_match(&#39;/\\.\\./&#39;, $local)) return false; // local part cannot have two consecutive dots
else if (!preg_match(&#39;/^[A-Za-z0-9\\-\\.]+$/&#39;, $domain)) return false; // domain part has invalid character
else if (preg_match(&#39;/\\.\\./&#39;, $domain)) return false; // domain part cannot have two consecutive dots
else if (!preg_match(&#39;/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\&#39;*+?^{}|~.-])+$/&#39;, str_replace("\\\\", "", $local))) // exception for quoted
if (!preg_match(&#39;/^"(\\\\"|[^"])+"$/&#39;, str_replace("\\\\", "", $local))) return false; // local part character invalid except when local part is quoted
if (!empty($modSettings[&#39;contact_form_skip_dns_check&#39;])) return true; // mod setting to skip the DNS A/MX record check
if (function_exists(&#39;checkdnsrr&#39;))
if (!(checkdnsrr($domain, &#39;MX&#39;) || checkdnsrr($domain, &#39;A&#39;))) return false; // domain does not have a valid A or MX record
else
if (!(win_checkdnsrr($domain, &#39;MX&#39;) || win_checkdnsrr($domain, &#39;A&#39;))) return false; // domain does not have a valid A or MX record
return true;
}

function 
win_checkdnsrr($host, $type)
{
if (!empty($host))
{
exec(&#39;nslookup -type=&#39; . $type . &#39; &#39; . escapeshellcmd($host), $result);
foreach ($result as $line)
if (eregi("^$hostName", $line)) return true;
}
return false;
}

?>


Czy kto? mi mo?e pomóc?

Z góry dzi?kuj? i pozdrawiam - Sandra


: : Attachment : :
Attachment

Attachment kontakt.PNG   -› 13.98 KB, 462x459 - wyświetlony 7159 razy

IP IP Zapisane

Pozdrawiam - Sandra
www.drlucy.pl
www.latoma.net