2011-04-08 4 views
0

내 고객이이 문제에 대한 해결책을 찾을 수 있는지 질문했습니다. 그의 웹 사이트 (여전히 WIP) http://welkommagazine.nl/luuk/에는 양식이 있습니다. 양식은 분명히 sendmail 스크립트를 사용하여 전자 메일로 양식을 보냅니다. 그 위에 그는 수동으로 모든 제출물을 복사/붙여 넣기하여 Excel로 복사합니다.Webforms in excel 대신 전자 메일

그가 원했던 것은 온라인 자동 작성 양식이 그가 많은 작업을 저장하기 위해 Excel 문서에 추가된다는 것입니다.

저는 프로그래머가 아니지만 디자이너입니다.이 작업을 수행 할 수 있다고 생각하지만, 실마리가 없습니다. 나는 그것에 대해 많이 찾았고, 내가 찾은 유일한 것은 dreamweaverplugin이었다.

이렇게하는 방법이 있습니까? 그렇다면 어떻게해야합니까?

답변

0

답을 직접 찾았습니다. 필자는 실제로 CSV 파일에 쉼표로 구분 된 필드를 저장하고 채워진 필드가있는 원하는 주소로 전자 메일을 보내는 PHP 코드 스 니펫을 작성했습니다.

 

if(isset($_POST['Submit'])){ 
    $pakket = $_POST['pakket']; 
    $extragidsen = $_POST['extragidsen']; 
    $naambedrijf = $_POST['naambedrijf']; 
    $err = ''; 

    if(trim($pakket)==''){ 
     $err .= '-Please enter a name
'; } if(empty($extragidsen)){ $err .= '-Please enter an email address'; } if(strlen($naambedrijf)==0){ $err .= '-Please enter a comment
'; } if($err!=''){ echo $err; } else{ $filename = 'file.csv'; $somecontent = $pakket . ',' . $extragidsen . ',' . $naambedrijf . "\n"; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } //--------------------------Set these paramaters-------------------------- // Subject of email sent to you. $subject = 'Inschrijving welkom'; // Your email address. This is where the form information will be sent. $emailadd = '[email protected]'; // Where to redirect after form is processed. $url = 'http://www.google.com'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty. $req = '0'; // --------------------------Do not edit below this line-------------------------- $text = "Results from form:\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { if ($req == '1') { if ($value == '') {echo "$key is empty";die;} } $j = strlen($key); if ($j >= 20) {echo "Name of form element $key cannot be longer than 20 characters";die;} $j = 20 - $j; for ($i = 1; $i '; fclose($handle); } else { echo "The file $filename is not writable"; } } }

아마도 코드는 깨끗할 수 있지만 어쩌면 작동합니다. 당신은 내가 지역 사회를 위해 자신이 대답 할 추측

을 :)하려는 경우 가 BTW 유 환호

"file.csv"에 권한을 설정 "쓰기"필요 ... 코드를 정리 주시기 바랍니다
2

프로그래머의 응답이 아니지만 ...
Google 워드 프로세서를 사용하는 것이 쉬운 해결책이라고 생각합니다. Google 스프레드 시트를 설정하고 여기에 양식을 연결할 수 있습니다. 사용자가 양식을 채울 때마다 데이터가 스프레드 시트에 추가됩니다.
고객이 언제든지 다운로드 할 수 있습니다.
시장에 나와있는 일부 제공 업체가 있으며 일부는 무료이며 일부는 제공하지 않습니다. 예 : wufoo.com

+0

정확히 내가 찾던 대답이 아니지만 살펴볼 것입니다. 감사! – Luuk

관련 문제