CF İMAGE HOST isimli scripti kullanmaktayım.
Scriptin iletişim bölümünde sorun var. Atılan mesajları mail adresime nasıl yönlendirecegim?
işte kodlar.
Scriptin iletişim bölümünde sorun var. Atılan mesajları mail adresime nasıl yönlendirecegim?
işte kodlar.
PHP:
<?php
//
// CF Image Hosting Script
// --------------------------
//
// Author: codefuture.co.uk
// Version: 1.4.1
// Date: 03 April 2011
//
// download the latest version from - http://codefuture.co.uk/projects/imagehost/
//
// Copyright (c) 2011 codefuture.co.uk
// This file is part of the CF Image Hosting Script.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//
// You may not modify and/or remove any copyright notices or labels on the software on each
// page (unless full license is purchase) and in the header of each script source file.
//
// You should have received a full copy of the LICENSE AGREEMENT along with
// CF Image Hosting Script. If not, see http://codefuture.co.uk/projects/imagehost/license/
//
////////////////////////////////////////////////////////////////////////////////////
require_once('inc/config.php');
if(!$settings['SET_HIDE_CONTACT']){
header('Location: index.php');
exit();
}
$errors = array();
$emailSent = false;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = input($_POST['name']);
$email = input($_POST['email']);
$comment = input($_POST['comment']);
if(empty($name)){
$errors['name'] = $LANGUAGE_PACK["site_contact_name_err_blank"];
}
if(empty($email)){
$errors['email'] = $LANGUAGE_PACK["site_contact_email_err_blank"];
}elseif(!eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $email) ||
preg_match("/(%0A|%0D|\n+|\r+)(content-type:|to:|cc:|bcc:)/i", $email) ||
preg_match("/(%0A|%0D|\n+|\r+)/i", $email)){
$errors['email'] = $LANGUAGE_PACK["site_contact_email_err_invalid"];
}
if(empty($comment)){
$errors['comment'] = $LANGUAGE_PACK["site_contact_comment_err_blank"];
}
//
if( !is_errors() ){
if(strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) $ent = "\r\n";
elseif(strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) $ent = "\r";
else $ent = "\n";
$comment = ' Name: '.$name.$ent.' E-mail: '.$email.$ent.' Comment: '.$ent.$comment;
$boundary = '----=_NextPart_' . md5(rand());
$headers = 'From: ' . $name . '<' . $email . '>' . $ent;
$headers .= 'X-Mailer: PHP/' . phpversion() . $ent;
$headers .= 'MIME-Version: 1.0' . $ent;
$headers .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $ent . $ent;
$message = '--' . $boundary . $ent;
$message .= 'Content-Type: text/plain; charset="utf-8"' . $ent;
$message .= 'Content-Transfer-Encoding: base64' . $ent . $ent;
$message .= chunk_split(base64_encode($comment));
ini_set('email', $email);
mail($settings['SET_CONTACT'], 'Email from contact form on '.$settings['SET_TITLE'], strip_tags(html_entity_decode($message)), $headers);
$emailSent = true;
}
}
$menu = 'contact';
$page_title = ' - Contact Page';
include_once('header.php');
echo '<div id="contact">
<h2>'.$LANGUAGE_PACK["site_menu_contact"].'</h2>
<div class="contactbox">';
if($emailSent){?>
<p class="teaser"><?=sprintf($LANGUAGE_PACK["site_contact_thank_you"],$name);?></p>
<? }else{ ?>
<p class="teaser"><?=$LANGUAGE_PACK["site_contact_des"];?></p>
<div id="form">
<form method="post" action="contact.php">
<?=is_errors('name');?>
<div class="code_box">
<label for="name"><?=$LANGUAGE_PACK["site_contact_form_name"];?></label>
<input name="name" type="text" id="name" class="text_input" size="24" value="<?=err_ReSet('name');?>" />
</div>
<?=is_errors('email');?>
<div class="code_box">
<label for="email"><?=$LANGUAGE_PACK["site_contact_form_email"];?></label>
<input name="email" type="text" id="email" class="text_input" size="24" value="<?=err_ReSet('email');?>" /><br/>
</div>
<?=is_errors('comment');?>
<div class="code_box contact">
<label for="comment"><?=$LANGUAGE_PACK["site_contact_form_comment"];?></label>
<textarea name="comment" id="comment" rows="8" cols="5" class="text_input long"><?=err_ReSet('comment');?></textarea>
</div>
<div class="code_box"><?=$CONTACT_CAPTCHA_IMG;?></div>
<input type="submit" class="button button_cen" value="<?=$LANGUAGE_PACK["site_contact_form_send"];?>" />
</form>
</div>
<?
}
echo '</div></div>';
include_once('footer.php');
function is_errors($name=lisanssız){
global $errors;
if(is_null($name) && count($errors)>0)return true;
if(isset($errors[$name]))
return '<span class="error_message">'.$errors[$name].'</span>';
return '';
}
function err_ReSet($name){
global $errors;
if(count($errors)>0 && isset($_POST[$name]))
return input($_POST[$name]);
return '';
}