Register for your free account! | Forgot your password?

Go Back   elitepvpers > General > Main
You last visited: Today at 09:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Kontakformular

Discussion on Kontakformular within the Main forum part of the General category.

Reply
 
Old   #1
 
caglarinho's Avatar
 
elite*gold: -1
Join Date: Apr 2009
Posts: 332
Received Thanks: 16
Kontakformular

Hallo com,

ich habe nach einem Kontaktformular gesucht und habs auch eins gefunden und bei einem Webspace ( funpic ) hochgeladen , das problem ist wenn ich das Formular ausfülle kommt keine Nachricht an meine Email und ich wollte fragen warum ?

Hier der Php code :
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Kontaktformular -- www.gaijin.at</title>

<meta name="title" content="Kontaktformular -- www.gaijin.at">
<meta name="description" content="Kontaktformular von www.gaijin.at">
<meta name="keywords" content="Kontakt, Kontaktformular">
<meta name="author" content="Gaijin.at">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>

<h1>Kontakt</h1><br>

<?php

// *** Einstellungen ***
$mail_to ''// Ihre Mailadresse (Empfängeradresse)

// #############################################################################
$from_name=GetParam('fromname');
$from_mail=strtolower(GetParam('frommail'));
$mail_subject=GetParam('mailsubject');
$mail_text=GetParam('mailtext');
$send=GetParam('s');

$err_text='';
if(
trim($from_name)==''$err_text.='Bitte geben Sie Ihren Namen an.<br>';
if(
trim($from_mail)=='')
  
$err_text.='Bitte geben Sie Ihre E-Mail-Adresse an.<br>';
else
  if(!
ereg('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$',$from_mail))
    
$err_text.='Bitte geben Sie eine gültige E-Mail-Adresse an.<br>';
if(
trim($mail_subject)==''$err_text.='Bitte geben Sie einen Betreff ein.<br>';
if(
trim($mail_text)==''$err_text.='Bitte geben Sie einen Nachrichtentext ein.<br>';

// *** Zu langen Text abschneiden ***
if(strlen($mail_text)>1000) {
  
$mail_text=substr($mail_text,0,1000).'... (Text wurde gekürzt!)';
}
$from_name=str_replace(chr(34),"''",$from_name);
$mail_subject=str_replace(chr(34),"''",$mail_subject);
$from_name=stripslashes($from_name);
$from_mail=stripslashes($from_mail);
$mail_subject=stripslashes($mail_subject);
$mail_text=stripslashes($mail_text);

if ((
$send == '1') && ($err_text != '')) {
  echo 
'<p><big><b>Fehler:</b></big><br>';
  echo 
$err_text.'</p>';
}

if ((
$send != '1') || ($err_text != '')) {
?>

<form action="<?=GetParam('PHP_SELF','S')?>" method="post">
<table border=0 cellspacing=2 cellpadding=0 width=100%>
<tr><td nowrap align=right>Ihr Name:</td><td>&nbsp;</td>
<td width=100%><input type="text" name="fromname" size=50 maxlength=120 value="<?=$from_name?>"></td></tr>
<tr><td nowrap align=right>Ihre E-Mail-Adresse:</td><td></td>
<td width=100%><input type="text" name="frommail" size=50 maxlength=120 value="<?=$from_mail?>"></td></tr>
<tr><td nowrap align=right>Betreff:</td><td></td>
<td width=100%><input type="text" name="mailsubject" size=50 maxlength=120 value="<?=$mail_subject?>"></td></tr>
<tr><td nowrap align=right valign=top>Text:<br><i>(max. 1.000 Zeichen)</i></td><td></td>
<td width=100%><textarea cols=40 rows=10 name="mailtext"><?=$mail_text?></textarea></td></tr>
<tr><td></td><td></td><td>
<input type="hidden" value="1" name="s">
<input type="submit" value="Nachricht versenden" name="submit">
</td></tr>
</table>
</form>

<?php
} else {
  
$header="From: $from_name <$from_mail>\n";
  
$header.="Reply-To: $from_mail\n";
  
$header.="X-Mailer: PHP-ContactForm-Script\n";
  
$header.="Content-Type: text/plain";
  
$mail_date=gmdate('D, d M Y H:i:s').' +0000';
  
$send=0;
  if(@
mail($mail_to,$mail_subject,$mail_text,$header))
  {
    echo 
"<p><b>Die Nachricht wurde erfolgreich abgesendet.</b></p>";
    echo 
"<p><a href=\"".GetParam('PHP_SELF','S')."?from_name=$from_name&from_mail=$from_mail\">Zurück zum Formular</a></p>";
  }else{
    echo 
"<p><b>Beim Versenden der Nachricht ist ein Fehler aufgetreten!</b></p>";
    echo 
"<p><a href=\"".GetParam('PHP_SELF','S')."?from_name=$from_name&from_mail=$from_mail&mail_subject=$mail_subject&mail_text=";
    echo 
urlencode($mail_text)."\">Zurück zum Formular</a></p>";
  }
}

function 
GetParam($ParamName$Method 'P'$DefaultValue '') {
  if (
$Method == 'P') {
    if (isset(
$_POST[$ParamName])) return $_POST[$ParamName]; else return $DefaultValue;
  } else if (
$Method == 'G') {
    if (isset(
$_GET[$ParamName])) return $_GET[$ParamName]; else return $DefaultValue;
  } else if (
$Method == 'S') {
    if (isset(
$_SERVER[$ParamName])) return $_SERVER[$ParamName]; else return $DefaultValue;
  }
}
?>

<p><a href="http://www.gaijin.at/">Copyright &copy; 2003-2009 www.gaijin.at</a></p>

</body>
</html>
MFG

caglar
caglarinho is offline  
Reply




All times are GMT +2. The time now is 09:35.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.