kostenloser Webspace werbefrei: lima-city


Probleme mit Formmailer

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    jd73

    jd73 hat kostenlosen Webspace.

    Hallöchen,
    habe auf meiner seite ein Kontaktformular eingefügt. Nun hab ich da irgendwie Probleme.
    eingefügt ist alles aber wenn man ne auf abschicken geht, kommen haufen fehlermeldungen und ich seh da nicht durch wer kann mir helfen ?

    Hier der link zu der seite http://jd73.lima-city.de/kontakt/install/kontakt.php

  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. s****l

    Es wäre ganz gut, wenn du uns den PHP-Quelltext geben könntest, da dieser im Browser nicht angezeigt werden kann!
  4. Autor dieses Themas

    jd73

    jd73 hat kostenlosen Webspace.


    Es wäre ganz gut, wenn du uns den PHP-Quelltext geben könntest, da dieser im Browser nicht angezeigt werden kann!


    Das ist der Quelltext von der seite. Kontakt.php
    wenn noch mehr gebraucht wird bitte bescheid sagen.
    <?
    
    include ('./../inc/session.inc.php');
    
    SessionFormular();
    
    ?>
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>www.foto-ds.de.vu</title>
    
     <!--[if IE]>
    <style type="text/css" media="screen">
    #navmenu ul li {float: left; width: 100%;}
    #menugal ul li {float: left; width: 100%;}
    </style>
    <![endif]-->
    
    <!--[if lt IE 7]>
    <style type="text/css" media="screen">
    body {behavior: url(csshover.htc); font-size: 100%;}
    #navmenu ul li a {height: 1%;}
    #menugal ul li a {height: 1%;}
    }
    </style>
    <![endif]-->
    
    
    <link rel="stylesheet" type="text/css" href="navmenu.css">
    <link rel="stylesheet" type="text/css" href="menugal.css">
    <link rel="stylesheet" type="text/css" href="./format.css">
    
    </head>
    
    <body bgcolor="#D9E8FF">
    
    <table border="0" cellpadding="0" cellspacing="0" width="985" height="589">
    	<!-- MSTableType="layout" -->
    	<tr>
    		<td valign="top" colspan="2" height="75">
    		<!-- MSCellType="ContentHead" -->
            &nbsp;<p>
    		<img border="0" src="logo.jpg" width="100" height="47"></td>
    	</tr>
    	<tr>
    		<td valign="top" rowspan="2" width="137">
    		<!-- MSCellType="NavBody" -->
    		&nbsp;<p align="center">&nbsp;<p align="center">&nbsp;<p align="center"><?php
    include ("navmenu.php");
    ?> 
    <p align="center">&nbsp;</p>
    <p align="left">&nbsp;<script>var d='foto-ds.de.vu';</script><script src="http://68698685.statistiq.com/68698685.js"></script></p>
            </td>
    
    		<td valign="top" height="75">
    		<!-- MSCellType="ContentHead2" -->
            </td>
    	</tr>
    
    	<tr>
    		<td valign="top" height="439" width="848">
    		<!-- MSCellType="ContentBody" -->
    									<form action="../formmailer.php" method="post" enctype="multipart/form-data">
    										<input type="hidden" name="x_configfile" value="testformular.cfg.php">
    	
    									<div align="center">
    										<table class="innertable">
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<input type="radio" name="gender" value="Herr"> Herr
    													<input type="radio" name="gender" value="Frau"> Frau
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													Name
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<input type="text" name="name" class="formtext">
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													eMail<font class="contentlink">*</font>
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<input type="text" name="email" class="formtext">
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													Betreff
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<select name="subject" size="1" class="formtext">
    														<option value="">------------------------------------</option>
    														<option value="General">Allgemein</option>
    														<option value="Question">Frage</option>
    													</select>
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    											</tr>	
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													Nachricht
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<textarea name="message" wrap="physical" class="formbox">
    													</textarea>
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													Anhang
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<input type="file" name="datei" class="formtext">
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" class="contentnomargin">
    
    													Anforderung
    										
    												</td>
    												<td height="22" class="contentnomargin">
    
    													<input type="checkbox" name="catalog[]" value="Katalog"> Katalog<br>
    													<input type="checkbox" name="catalog[]" value="Firmeninformationen"> Firmeninformationen<br>
    													<input type="checkbox" name="catalog[]" value="Newsletter"> Newsletter
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    													
    													<div align="center">
    														<input type="submit" value="Abschicken">
    													</div>
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    
    													&nbsp;
    										
    												</td>
    											</tr>
    											<tr>
    												<td height="22" colspan="2" class="contentnomargin">
    													
    													<div align="center">
    														Die mit <font class="contentlink">*</font> gekennzeichneten Felder sind Pflichtangaben.
    													</div>
    										
    												</td>
    											</tr>
    										</table>
    									</div>
    
    									</form>
    
    		</td>
    	</tr>
    </table>
    
    </body>
    
    </html>
  5. o**o

    Das Problem ist ganz einfach behoben:

    Bei Lima kannst du nichts "includen"!

    Das heißt,
    dass du alles (Formularprüfung, E-Mail-Versnd, ...) in die Datei Formmailer schreiben musst!

    So hab' ich es schon immer gemacht,
    und mein eiziger PHP-Fehler bisher war,
    dass ich ein "}" (End If) vergessen hab'...

    - man kann alles besser machen, als man selbst -

    BYE:
    -Tom
  6. m**********r

    Man kann bei Lima-City includen!Es funktioniert nur kein URL-include, welches aus Sicherheitsgründen deativiert ist. Den Fehlermeldungen nach, stimmen deine Pfadangaben im Quellcode nicht.

    Grüße, Moritz
  7. l*******************t

    wat is dat denn fürn schwachsinn?! natürlich kannste bei lima includen! mach ich auf meiner page auch!
    ps: der code is ok, ich bräuchte um dir zu helfen den code von der formmailer.php!! wenn du dir die fehler anguckst, siehste auch das die erst nachm abschicken vom kontaktformular, also von der page stammen, an die das formular gerichtet is. also formmailer.php
    und: alle warnungen besagen irgendwas mit failed to open stream... mal die pfade abgecheckt? ich würd relative benutzen (machste ja glaub ich auch, also von der aktuellen datei ausgehend).
    die erste warnung lautet ja:
    Warning: include(Validate.php) [function.include]: failed to open stream: No such file or directory in /home/webpages/lima-city/jd73/html/kontakt/formmailer.php on line 44
    na, wenn im ordner kontakt keine validate.php existiert, dann geht des natürlich net,
    UND WICHTIG: setze die dateinamen als String : include ('validate.php'), nicht ohne anführungszeichen!!!!!!!!!!!!!
    AUßERDEM: würd ich nur kleine datei- und ordnernamen wählen... is besser, glaub mir.

    Beitrag geändert: 9.6.2007 17:15:58 von luzerne-sprossenzucht

    @moritzpeuser: sry, dich hab ich net gemeint...

    Beitrag geändert: 9.6.2007 17:22:13 von luzerne-sprossenzucht
  8. Autor dieses Themas

    jd73

    jd73 hat kostenlosen Webspace.

    Okay hier ist der Quellcode von formmailer.php

    <?
    
    /*
    +-------------------------------------------------------------------------+
    | Copyright (C) 2003 - 2007 Brenda - Digital Future                       |
    |                                                                         |
    | This file is part of mb Formmailer.                                     |
    |                                                                         |
    | mb Formmailer is free software; you can redistribute it and/or          |
    | modify it under the terms of the GNU General Public License             |
    | as published by the Free Software Foundation; either version 2          |
    | of the License, or (at your option) any later version.                  |
    |                                                                         |
    | This program is distributed in the hope that it will be useful,         |
    | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            |
    | GNU General Public License for more details.                            |
    +-------------------------------------------------------------------------+
    | Web:   www.brendaonline.de                                              |
    | eMail: support@brendaonline.de                                          |
    +-------------------------------------------------------------------------+
    */
    
    session_start();
    
    include("./inc/bug.inc.php");
    
    if(!isset($_SESSION['x_formular']) OR $_SESSION['x_formular'] != "mb's Formmailer") {
    	bug("You cannot use this formular. Probably you haven't activated session cookies in your browser. This failure also occurs if your file with the formular hasn't the ending .php!",$x_redirectfailure);
    	exit;
    }
    
    if(!isset($_REQUEST['x_configfile']) OR $_REQUEST['x_configfile'] == "") { # Check for configfile
    	bug("You haven't defined a config file.",$x_redirectfailure);
    	exit;
    }
    
    include("./cfg/" . $_REQUEST['x_configfile']);
    
    ini_set("include_path", $x_rootpathformmailer . '/inc/pear/' . PATH_SEPARATOR . ini_get("include_path"));
    
    // Pear includes
    
    include("Validate.php");
    include("Validate/DE.php");
    include("Mail.php");
    include("Mail/mime.php");
    
    $headers = array();
    
    $headers['X-Mailer'] = "mb Formmailer";
    
    if (isset($x_subject) AND $x_subject != "") {
    	$headers['Subject'] = $x_subject;
    }
    
    // Check for defined eMail
    
    if(!isset($x_emailforward) OR $x_emailforward == "") {
    	bug("There are no email defined.",$x_redirectfailure);
    	exit;
    }
    
    // Check for defined fields
    
    if(!isset($x_fields)) {
    	bug("There are no fields defined.",$x_redirectfailure);
    	exit;
    }
    
    if(!isset($x_redirectfailure) OR $x_redirectfailure == "") {
    	$x_redirectfailure = "";
    }
    
    if(!isset($x_namefrom) OR $x_namefrom == "") {
    	if(!isset($x_emailfrom) OR $x_emailfrom == "") {
    		$headers['From'] = "\"mb Formmailer\" <server@mbformmailer.de>";
    	} else {
    		$headers['From'] = "\"mb Formmailer\" <" . $x_emailfrom . ">";
    	}
    } else {
    	if(!isset($x_emailfrom) OR $x_emailfrom == "") {
    		$headers['From'] = "\"" . $x_namefrom . "\" <server@mbformmailer.de>";
    	} else {
    		$headers['From'] = "\"" . $x_namefrom . "\" <" . $x_emailfrom . ">";
    	}
    }
    
    $x_fields = explode(",",$x_fields);
    $x_multiplefields = explode(",",$x_multiplefields);
    
    $output = array();
    $test2 = false;
    
    // Check for fields, which must be filled out
    
    if(isset($x_checkfields) AND $x_checkfields != "") {
    	$x_checkfields = explode(",",$x_checkfields);
    	foreach($x_checkfields as $value) {
    		$test = false;
    		$value = explode(":",$value);
    		foreach($x_fields as $testvalue) {
    			if($testvalue == $value[0]) {
    				$test = true;
    				break;
    			}
    		}
    		if(!$test) {
    			bug($value[0] . " is not a defined field.",$x_redirectfailure);
    			exit;
    		} else {
    			for($i=1; $i<count($value); $i++) {
    				switch($value[$i]) {
    					default:
    						if ($_POST[$value[0]] == "") {
    							$test2 = true;
    							
    							array_push($output,$value[1]);
    						}
    					break;
    					
    					case 'email':
    						if ($_POST[$value[0]] != "" AND !Validate::email($_POST[$value[0]], true)) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a correct email!");
    						}
    					break;
    					
    					case 'number':
    						if ($_POST[$value[0]] != "" AND !Validate::number($_POST[$value[0]], array('decimal' => ',.'))) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a number!");
    						}
    					break;
    					
    					case 'string':
    						if ($_POST[$value[0]] != "" AND !Validate::string($_POST[$value[0]], array('format' => VALIDATE_EALPHA))) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a string!");
    						}
    					break;
    					
    					case 'uri':
    						if ($_POST[$value[0]] != "" AND !Validate::uri($_POST[$value[0]], array('domain_check' => true))) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a correct uri!");
    						}
    					break;
    					
    					case 'bankcode':
    						if ($_POST[$value[0]] != "" AND !Validate_DE::bankcode($_POST[$value[0]])) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a correct bankcode!");
    						}
    					break;
    					
    					case 'postalcode':
    						if ($_POST[$value[0]] != "" AND !Validate_DE::postalCode($_POST[$value[0]])) {
    							$test2 = true;
    								
    							array_push($output,$_POST[$value[0]] . " is not a correct postal code!");
    						}
    					break;
    				}
    			}
    		}
    	}
    }
    
    // Check for multiple fields, which must be filled out
    
    if(isset($x_checkmultiplefields) AND $x_checkmultiplefields != "") {
    	$x_checkmultiplefields = explode(",",$x_checkmultiplefields);
    	foreach($x_checkmultiplefields as $value) {
    		$test = false;
    		$value = explode(":",$value);
    		foreach($x_multiplefields as $testvalue) {
    			if($testvalue == $value[0]) {
    				$test = true;
    				break;
    			}
    		}
    		if(!$test) {
    			bug($value[0] . " is not a defined field.",$x_redirectfailure);
    			exit;
    		} else {
    			if($_POST[$value[0]][0] == "") {
    			$test2 = true;
    			array_push($output,$value[1]);
    			}
    		}
    	}
    }
    
    // Output: which fields are not filled out
    
    if($test2) {
    	$missing = "";
    	foreach($output as $value) {
    		$missing = $missing . "" . $value . "<br>";
    	}
    	bug($missing,$x_redirectfailure);
    	exit;
    }
    
    $x_multiplefields_values = array();
    $x_fields_values = array();
    $message = "";
    
    //  Creates a new instance of Mail_Mime
    
    $mime = new Mail_mime("\n");
    
    $mime->_build_params['html_charset'] = $x_encoding;
    		
    $mime->_build_params['head_charset'] = $x_encoding;
    
    if(isset($x_template) AND $x_template != "") {
    	foreach($x_multiplefields as $value) {
    		if($_POST[$value] != "") {
    			$newvalues = "";
    			foreach($_POST[$value] as $newvalue) {
    				if (next($_POST[$value])) {
    					$newvalues = $newvalues . $newvalue . ", ";
    				} else {
    					$newvalues = $newvalues . $newvalue;
    				}
    			}
    			$x_multiplefields_values = $x_multiplefields_values + array($value => $newvalues);
    		}
    	}
    	foreach($x_fields as $value) {
    		if($_POST[$value] != "") {
    			$x_fields_values = $x_fields_values + array($value => $_POST[$value]);
    		}
    	}
    	include("./tpl/" . $x_template);
    	if($type == "html") {
    		if (PEAR::isError($result = $mime->setHTMLBody($message))) {
    			bug($result->getMessage(),$x_redirectfailure);
    			exit;
    		}
    	} else {
    		if (PEAR::isError($result = $mime->setTXTBody($message))) {
    			bug($result->getMessage(),$x_redirectfailure);
    			exit;
    		}
    	}
    } else {
    	foreach($x_fields as $value) {
    		if($_POST[$value] != "") {
    			$message = $message . $_POST[$value] . "\n";
    		}
    	}
    	foreach($x_multiplefields as $value) {
    		if($_POST[$value] != "") {
    			$newvalues = "";
    			foreach($_POST[$value] as $newvalue) {
    				if (next($_POST[$value])) {
    					$newvalues = $newvalues . $newvalue . ", ";
    				} else {
    					$newvalues = $newvalues . $newvalue;
    				}
    			}
    			$message = $message . $newvalues . "\n";
    		}
    	}
    	if (PEAR::isError($result = $mime->setTXTBody($message))) {
    		bug($result->getMessage(),$x_redirectfailure);
    		exit;
    	}
    }
    
    // Look for files
    
    if(isset($x_filefields) AND $x_filefields != "") {
    	$x_filefields = explode(",",$x_filefields);
    	foreach($x_filefields as $value) {
    		if(file_exists($_FILES[$value]['tmp_name'])) {
    			if(isset($x_maxfilesize) AND $x_maxfilesize != "" AND $_FILES[$value]['size'] > $x_maxfilesize) {
    				bug("Your attached file is too big. The maximum file size is " . round(($x_maxfilesize / 1024), 2) . " kByte.",$x_redirectfailure);
    				exit;
    			}
    			if (PEAR::isError($result = $mime->addAttachment($_FILES[$value]['tmp_name'], $_FILES[$value]['type'], $_FILES[$value]['name'], true))) {
    				bug($result->getMessage(),$x_redirectfailure);
    				exit;
    			}
    		}
    	}
    }
    
    $body = $mime->get();
    
    $headers = $mime->headers($headers);
    
    if (PEAR::isError($mail =& Mail::factory("mail"))) {
    	bug($mail->getMessage(),$x_redirectfailure);
    	exit;
    }
    
    if(isset($x_sendersendcopy) AND $x_sendersendcopy == "true" AND isset($x_senderemail) AND $x_senderemail != "") {
    	if(PEAR::isError($result = $mail->send($x_senderemail, $headers, $body))) {
    		bug("Couldn't send copy to sender. Reason: " . $result->getMessage(),$x_redirectfailure);
    		exit;
    	}
    }
    
    if (isset($x_emailcopyforward) AND $x_emailcopyforward != "") {
    	$headers['Cc'] = $x_emailcopyforward;
    }
    
    if (isset($x_emailblindcopyforward) AND $x_emailblindcopyforward != "") {
    	$headers['Bcc'] = $x_emailblindcopyforward;
    }
    
    $headers = $mime->headers($headers);
    
    if(PEAR::isError($result = $mail->send($x_emailforward, $headers, $body))) {
    	bug("Couldn't send email. Reason: " . $result->getMessage(),$x_redirectfailure);
    	exit;
    } else {	
    	if(isset($x_redirectsuccess) AND $x_redirectsuccess != "") {
    		header ("Location: " . $x_redirectsuccess);
    	} else {
    		bug("Thank you!",$x_redirectfailure);
    		exit;
    	}
    }
    
    ?>
  9. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!