| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: Aug 2008
Beiträge: 2
| Kontakt-Formular
Hallo! :-) Dies ist mein erster Beitrag hier, ich grüße Euch alle, und gleich entschuldige mich für mein evtl. schlechtes Deutsch. Ich habe ein folgendes Problem: ich habe ein gekaufter Template und von Php versteh ich leider soviel wie auch von Flugkörpern :-( wie wir Mädels so auch alle sind ;-) Kann mir da jemand mal helfen bitte? In dem Homepage-Ordner habe ich folgende Dateien zu handhaben, die eventuelll zum Kontakt-Script passen würden: contact.php contact.asp Was soll ich, und vorallem wochin was schreibe, damit mein Kontakt-Formular dann funktioniert? Das Contact.php-Script sieht folgendermaßen aus: <?php //-----------------Getting data sent by flash--------------------- foreach ($_POST as $key => $value){ if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){ $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>'; $mail_body .= ''.stripslashes($value).'<br/>'; } } //----------------------------------------------------------------- $message = '<html><body>'.$mail_body.'</body></html>'; // mail body //------------if plain text is set to true removing html tags------ if ($_POST['plain_text']=='true') { $message = str_replace('<br/>',"\r\n", $message); $message = strip_tags($message); //------------------------------------------------------------------ } else { //----otherwise composing message headers--------------------------- $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //------------------------------------------------------------------ } //------------setting conf data------------------------------------- $to = $_POST['mail_to']; $from = $_POST['mail_from']; $subject = $_POST['mail_subject']; $smtp_server = $_POST['smtp_server']; $smtp_port = $_POST['smtp_port']; //------------------------------------------------------------------ //---------setting header info-------------------------------------- $headers .= 'To: '.$to. "\r\n"; $headers .= 'From: Site visitor ' .$from. "\r\n"; //------------------------------------------------------------------ if (mail($to, $subject, $message, $headers)){ // sending mail print('&mail=1'); //succes } else { print('&mail=0');//failure } ?> Das Contact.sp-Script sieht folgendermaßen aus: <% '----function that removes html tags----------- Function RemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "<[^>]*>" RegEx.Global = True RemoveHTML = RegEx.Replace(strText, "") End Function '--------------------------------------------- '------defining script vars------------------- Dim mailObj, mailCfg, myBody, fld Dim RegEx set RegEx = New RegExp '-------------------------------------------- '------getting data sent by flash (filtering configuration data)------------ For Each fld in Request.Form If Request.Form(fld) <> "" and _ fld <> "mail_to" and _ fld <> "smtp_server" and _ fld <> "smtp_port" and _ fld <> "plain_text" and _ fld <> "mail_from" and _ fld <> "mail_subject" Then myBody = myBody & vbCRLF & " <b>" & fld & "</b> :<br/> " & Trim(Request.Form(fld)) & "<br/>" End If Next '--------------------------------------------------------------------------- '----------setting conf data------------------------------------------------ On Error Resume Next Set myMail = CreateObject("CDO.Message") myMail.Subject = Request.Form("mail_subject") myMail.From =Request.Form("mail_from") myMail.To = Request.Form("mail_to") '--------if plain text is set to true removing html--------------------------------------- if Request.Form("plain_text") = "true" then myMail.TextBody = RemoveHTML(myBody) '-------otherwise composing message body-------------------------------------------------- else myMail.HTMLBody = "<html><body>" & myBody & "</body></html>" end if '----------setting configuration params for smtp---------------------------------------------------------------------------------- myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Request.Form("smtp_server") myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Request.Form("smtp_port") myMail.Configuration.Fields.Update '--------------------------------------------------------------------------------------------------------------------------------- myMail.Send '---------------sending message If Err = 0 Then Response.Write("&mail=1") 'if there the message is sent return 1 to flash Else Response.Write("&mail=0") 'otherwise return 0 End If %> |
| | |
| | #2 (permalink) |
| mod_rewrite Registriert seit: Feb 2003 Ort: München
Beiträge: 15.621
|
Bitte nicht das gleiche mehrfach posten. Danke! Hab die beiden anderen Beiträge von dir zu diesem Thema gelöscht.
__________________ RTFM Wie man Fragen richtig stellt. Achim Bindannmalweg Money makes the world go round, fear makes it turn much faster. (New Model Army) |
| | |
| | #3 (permalink) |
| Neuer User Registriert seit: Aug 2008
Beiträge: 2
|
Bitte um Entschuldigung, bin das erste Mal überhaupt in solchen Profi-Foren, Seid nicht böse ![]() Ich bitte Euch um Hilfe. wäre seeeeehr verbunden!!! Geändert von Ich bin Melany (21-08-2008 um 22:33 Uhr) Grund: Mein Deutsch ist nicht so gut, habe einige Fehler korregiert. |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |