Модераторы: skyboy, MoLeX, Aliance, ksnk
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Форма обратной связи, как отослать e-mail с клиента 
:(
    Опции темы
VitaL
Дата 17.9.2006, 08:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 94
Регистрация: 24.6.2006

Репутация: нет
Всего: нет



Ребята, помогите плз, очень нужно. Можно ли приписать в html скрипт  JavaScripts для "Обратная связь" 
у меня такие поля... 

user posted image

Можно ли сделать чтоб мне посылало на мыло инфу из этих полей.
 smile 

Буду очень признателен за помощь.
Спасибо.

Код

    <table cellpadding="0" cellspacing="0" border="0" width="157">                                                                    <tr><td colspan="2" valign="top"><b>The Company Name Inc</b></td></tr>
<tr><td colspan="2" valign="top">8901 Marmora Road,<br>Glasgow, D04 89GR</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr>
<td width="67" valign="top">Freephone:</td>
<td width="90" valign="top">+1 800 559 6580</td>
</tr>
<tr>
<td width="67" valign="top">Telephone:</td>
<td width="90" valign="top">+1 959 603 6035</td>
</tr>
<tr>
<td width="67" valign="top">FAX:</td>
<td width="90" valign="top">+1 101 889 9898 </td>
</tr></table>

PM MAIL WWW Skype   Вверх
skyboy
Дата 17.9.2006, 09:35 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


неОпытный
****


Профиль
Группа: Модератор
Сообщений: 9820
Регистрация: 18.5.2006
Где: Днепропетровск

Репутация: 75
Всего: 260



VitaL, зачем - из javascript - на мыло? лучше из javascript -> PHP -> mail.
Впрочем, я могу чего - то не знать....
Ещё вариант: эмулировать переход по ссылке "mailto:... ", вроде такого
PM MAIL   Вверх
VitaL
Дата 17.9.2006, 21:12 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 94
Регистрация: 24.6.2006

Репутация: нет
Всего: нет



Цитата(skyboy @ 17.9.2006,  09:35)
VitaL, зачем - из javascript - на мыло? лучше из javascript -> PHP -> mail.
Впрочем, я могу чего - то не знать....
Ещё вариант: эмулировать переход по ссылке "mailto:... ", вроде такого

Да ты скорей всео прав. лучше из javascript -> PHP -> mail.
за ссылку спасибо но это не то что нужно, не через аутлук.

У меня есть скрипт опроса который посылает на мыло ответ опроса без аутлука. Можно ли его переделать чтоб скрипт забирал инфу с тех полей, которые указаны выше, и высылал их на мыло без.

Новерно это нужно спрашивать на другом субфоруме сори но всё же

Код

<STYLE>
body,table,td {font: normal 11px Verdana, Geneva, Arial, Helvetica, sans-serif; color: #216086; text-decoration: none; }
</STYLE>

<DIV align="center">
<?
//hi yang hacker :)
$_POST[username]=strip_tags($_POST[username]);
$_POST[usermail]=strip_tags($_POST[usermail]);


//Variables
/*
*    $questions - Questions , $answer - Answers for questions
*    !!! Sum of questions = sum array's of answer !!!
*/
$questions=array(
"1. Do you think that the number of employees in your company from the following groups reflects the social composition of your area (city/country….)?",
"2. Do you think that the members of the following groups are offered the equal benefits for the like work and are given the equal career opportunities as other employees?",
"3. Do you think that your company sales and marketing strategy and marketing materials are taking into consideration clients from the following social groups?",
"4. Does your company provide child care programs and facilities and maternity leave benefits beyond legal requirements?",
"5. Are your company's premises easily accessible for disabled people beyond legal requirements, and does your company provide special equipment to assist people with disabilities in their work place?",
"6. Did your company remove any mandatory retirement age and does it recruit staff over 50?",
"7. Does your company provide programs for improving awareness of cultural and ethnic diversity?",
"8. Does your company have disciplinary procedures that deal with harassment and bulling of non-heterosexual employees at the work place?",
"9. Does your company provide time off work to accommodate key religious holidays for employees from various religious groups?", 
<br><br>
<hr><br><h2><b>hi</b></h2><hr>
<br><br>
"1. Is your company making every effort to minimize the generation of potentially harmful emissions or byproducts during the normal usage of your products?",
"2. Are the plans and procedures for safe disposal of your products at the end of their useful lives included in your product design process?",
"3. Please evaluate the efforts your company is making to design the packaging and packaging disposal in environment-friendly fashion.",
"4. How would you describe your company's efforts to improve energy efficiency of your products and /or their disposal processes at the end of their useful lives?",
"5. Is your company ensuring that any potential environmental hazard is clearly described on the products packaging and in its documentation, together with an instructions for energy optimal usage?",
"6. When choosing a new supplier, does your company taking into consideration their environmental records and environmental compliance of their processes?",
"7. Did your company make any attempts to replace potentially harmful raw material or component with safer alternatives?",
"8. Do you have a program for safe disposal of all potentially environmentally harmful substances generated during your production process?",
"9. Do you have environmental awareness programs / training for office and other non-production staff?",
"1. Does your company have pricing policy, sales procedures and customer care service which accommodate small, possibly dependant customers with low budgets?",
"2. Does your company enforce strict quality control procedures in all stages of your business cycle, combined with user friendly return policies?",
"3. Is your company ensuring that every promotion and advertising output describes the product and all its features honestly and accurately beyond the legal requirements?",
"4. Does your company have formal or informal measures in place to assist small, possibly dependant suppliers?",
"5. Does your company publicize tender information even when not required by low and are your tender advertisements published in media easily accessible to small businesses?",
"6. Does your company ensure that minority and small shareholders without board representation are kept informed or consulted on key business decisions?",
"7. Did your company put in place systems and procedures to measure and control the social responsibility or lack of it in all activities of various company departments?",
"8. Does your company have an employee/manager, whose duties include monitoring all company's activities for social responsibility or lack of it? ",
"1. Does your company have training program, which includes financially supporting and rewarding employees who undertake courses ranging from professional training to higher degrees?",
"2. Does your company have an effective, working system of employee feedback?",
"3. Does your company have a policy of giving priority to the internal candidates for all vacancies whenever feasible? ",
"4. Does your company exceed legal requirement when it comes to the health, safety and welfare in workplace?",
"5. Does your company encourage healthy work/life balance for all staff, by offering flexible working hours, work from home or similar measures?",
"6. Would you describe the remuneration packages in your company as more generous than the industry average packages for the like work?",
"1. Is your company regularly working with or contributing to charitable organization?",
"2. Does your company provide any financial support to local community activities and/or projects?",
"3. Does your company offer work experience or training programs to the members of the local community?",
"4. Does your company provide sponsorships for local sportsmen or women, museums, schools or other similar organisations?"
);

$answer=array(
    array(//question 1
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 2
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"
    ),
    array(//question 3
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"
    ),
    array(//question 4
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"
    ),
    array(//question 5
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 6
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 7
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"
    ),
    array(//question 8
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 9
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 10
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 11
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 12
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 13
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 14
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 15
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 16
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 17
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 18
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 19
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 20
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"        
    ),
    array(//question 21
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 22
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 23
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 24
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 25
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 26
        "Duties not asigned",
        "Part-time or occasional activity",
        "Full-time junior employee",
        "Full-time senior manager",
        "Full-time team"    
    ),
    array(//question 27
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 28
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 29
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 30
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"    
    ),
    array(//question 31
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"
    ),
    array(//question 32
        "Not at all",
        "Somewhat",
        "Partially",
        "Mostly",
        "Completely"        
    ),
    array(//question 33
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"        
    ),
    array(//question 34
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 35
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"    
    ),
    array(//question 36
        "Never",
        "Occasionally",
        "Average",
        "Mostly",
        "Always"        
    )
);

$email="[email protected]"; // to send email
$subject="Questions";        // Title email


if($_POST["Send"]){
        $headers = 'From: '.$email.'' . "\r\n" .
     'Reply-To: '.$email.'' . "\r\n" .
     'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     
     
     $body="<b>Answers from $_POST[username] <$_POST[usermail]></b><br>".date("d/m/Y G:i:s")."<br><br>";
          
     for($i=0,$end=count($questions); $i<$end ; $i++){
         if(isset($_POST["answ$i"])){
             $body.="<B>$questions[$i]:</B>".$_POST["answ$i"]."<br>";
         }
     }

     mail($email,$subject,$body,$headers);
}else{
?>

    <TABLE>
        <TR>
            <TD>
                <FORM action="<?=$_SERVER['SCRIPT_NAME']?>" method="POST">
                You name:<INPUT type="text" name="username">
                You e-Mail:<INPUT type="text" name="usermail">
                <BR><BR>
                <?
                foreach ($questions as $k=>$v){
                    echo "<hr><li><b>$v</b><br><br>";
                    if(!is_array($answer[$k])) die("Error: No answers for '$v' question !");
                    foreach ($answer[$k] as $kk=>$vv){
                        echo "<input name='answ$k' value='$vv' type='radio'>$vv<br>";
                    }
                    echo "</li>";
                }
                ?>
                <INPUT type="submit" name="Send" value="Submit">
                </FORM>            
            </TD>
        </TR>
    </TABLE>

    
    
<?}?>
</DIV>


 

спасибо
PM MAIL WWW Skype   Вверх
skyboy
Дата 17.9.2006, 21:20 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


неОпытный
****


Профиль
Группа: Модератор
Сообщений: 9820
Регистрация: 18.5.2006
Где: Днепропетровск

Репутация: 75
Всего: 260



VitaL, лучше обратись на форум по PHP.
PM MAIL   Вверх
Sardar
Дата 18.9.2006, 01:43 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бегун
****


Профиль
Группа: Модератор
Сообщений: 6986
Регистрация: 19.4.2002
Где: Нидерланды, Groni ngen

Репутация: 4
Всего: 317



Цитата(VitaL @  17.9.2006,  20:12 Найти цитируемый пост)
за ссылку спасибо но это не то что нужно, не через аутлук.

Тогда никак, только через сервер. Мыло вообще с клиента не посылают. В твоём скрипте строки 318-332 занимаються отправкой мыла, остальное шелуха.

Переношу в PHP из JS.


--------------------
 Опыт - сын ошибок трудных  © А. С. Пушкин
 Процесс написания своего велосипеда повышает профессиональный уровень программиста. © Opik
 Оценить мои качества можно тут.
PM   Вверх
VitalikOmsk
Дата 19.9.2006, 09:01 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 133
Регистрация: 13.10.2005

Репутация: нет
Всего: нет



вот ссылка читай http://www.phpclub.ru/detail/article/mail
PM MAIL   Вверх
VitaL
Дата 20.9.2006, 06:20 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 94
Регистрация: 24.6.2006

Репутация: нет
Всего: нет



спасибо, интересная страничка, но после установке на сервер открывается белая страница... smile 
сервер поддерживает php

 smile 
PM MAIL WWW Skype   Вверх
Sardar
Дата 20.9.2006, 16:46 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бегун
****


Профиль
Группа: Модератор
Сообщений: 6986
Регистрация: 19.4.2002
Где: Нидерланды, Groni ngen

Репутация: 4
Всего: 317



Цитата(VitaL @  20.9.2006,  05:20 Найти цитируемый пост)
сервер поддерживает php

mail, да и вообще исходящие коннекты далеко не каждый бесплатный сервер предоставит (к счастью), ибо спам рассылать можно. Купи хост и оговори в договоре возможность рассылки писем (все платные предоставляют, правда контролируемо, что бы спама не было).


--------------------
 Опыт - сын ошибок трудных  © А. С. Пушкин
 Процесс написания своего велосипеда повышает профессиональный уровень программиста. © Opik
 Оценить мои качества можно тут.
PM   Вверх
VitaL
Дата 21.9.2006, 01:04 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 94
Регистрация: 24.6.2006

Репутация: нет
Всего: нет



Цитата(Sardar @ 20.9.2006,  16:46)
Цитата(VitaL @  20.9.2006,  05:20 Найти цитируемый пост)
сервер поддерживает php

mail, да и вообще исходящие коннекты далеко не каждый бесплатный сервер предоставит (к счастью), ибо спам рассылать можно. Купи хост и оговори в договоре возможность рассылки писем (все платные предоставляют, правда контролируемо, что бы спама не было).

что меня и настораживает, хост поддерживает php у меня там даже портал стоит... http://nom-team.com.ar/

я открыл субдомен и хочу подсоединить обратную связь здесь http://daotravel.nom-team.com.ar/contact.html

но не получается. я делаю архив .пхп но появляется  белая страница smile 
PM MAIL WWW Skype   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "PHP"
Aliance
IZ@TOP
skyboy
SamDark
MoLeX

Новичкам:

  • PHP редакторы собираются и обсуждаются здесь
  • Электронные книги по PHP, документацию можно найти здесь
  • Интерпретатор PHP, полную документацию можно скачать на PHP.NET

Важно:

  • Не брезгуйте пользоваться тегами [code=php]КОД[/code] для повышения читабельности текста/кода.
  • Перед созданием новой темы воспользуйтесь поиском и загляните в FAQ
  • Действия модераторов можно обсудить здесь

Внимание:

  • Темы "ищу скрипт", "подскажите скрипт" и т.п. будут переноситься в форум "Web-технологии"
  • Темы с именами: "Срочно", "помогите", "не знаю как делать" будут УДАЛЯТЬСЯ

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, IZ@TOP, skyboy, SamDark, MoLeX, awers.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | PHP: Общие вопросы | Следующая тема »


 




[ Время генерации скрипта: 0.0828 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.