Hallo, wie der Titel es vermuten mag habe ich ein include problem.
die datei:
liegt im Unterordner kontakt.
Nun soll diese via
eingebunden werden.
Hier die Datei in der die einzufügene Datei eingebunden werden soll
Mein Problem ist das die Datei nicht angezeigt wird. Also wenn Sie eingebunden ist wird sie im Browser nicht angezeigt.
Habt Ihr einen Rat?.
Danke
die datei:
Code:
<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (isset($_POST['captcha_code'],$_SESSION['random_txt']) && md5($_POST['captcha_code']) == $_SESSION['random_txt'])
{
unset($_POST['captcha_code'],$_SESSION['random_txt']);
}
else
{
echo '<b>Der eingegebene Coda war falsch.</b><br>';
echo '<a href="javascript:history.back()">Go Back</a>';
exit;
}
}
?>
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$mailto = 'marc.afd@googlemail.com';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Kontaktaufnahme';
$message = 'Übermittelt aus Kontaktformular:';
$success_url = '';
$error_url = '';
$error = '';
$eol = "\n";
$max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;
$boundary = md5(uniqid(time()));
$header = 'Von: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address is invalid!\n<br>";
}
if (!empty($error))
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $error, $errorcode);
echo $errorcode;
exit;
}
$internalfields = array ("submit", "reset", "send", "captcha_code");
$message .= $eol;
$message .= "IP Addresse : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
mail($mailto, $subject, $body, $header);
header('Location: '.$success_url);
exit;
}
?>
<script type="text/javascript">
<!--
function ValidateKontakt(theForm)
{
var regexp;
if (theForm.Anrede.selectedIndex < 0)
{
alert("Please select one of the \"Anrede\" options.");
theForm.Anrede.focus();
return false;
}
regexp = /^[A-Za-zƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f]*$/;
if (!regexp.test(theForm.Vorname.value))
{
alert("Please enter only letter and whitespace characters in the \"Vorname\" field.");
theForm.Vorname.focus();
return false;
}
regexp = /^[A-Za-zƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f]*$/;
if (!regexp.test(theForm.Nachname.value))
{
alert("Please enter only letter and whitespace characters in the \"Nachname\" field.");
theForm.Nachname.focus();
return false;
}
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (theForm.Email.value.length != 0 && !regexp.test(theForm.Email.value))
{
alert("Please enter a valid email address.");
theForm.Email.focus();
return false;
}
return true;
}
//-->
</script>
</head>
<body>
<div id="container">
<div id="wb_Form1" style="position:absolute;background-color:transparent;left:1px;top:0px;width:500px;height:500px;z-index:15">
<form name="Kontakt" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" id="Form1" onsubmit="return ValidateKontakt(this)">
<div id="wb_Text1" style="margin:0;padding:0;position:absolute;left:10px;top:15px;width:71px;height:16px;text-align:left;z-index:0;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Anrede:</span></div>
<div style="position:absolute;left:91px;top:15px;width:198px;height:20px;border:1px #C0C0C0 solid;z-index:1">
<select name="Anrede" size="1" id="Anrede" style="position:absolute;left:0px;top:0px;width:100%;height:100%;border-width:0px;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;">
<option>Herr</option>
<option>Frau</option>
</select>
</div>
<div id="wb_Text2" style="margin:0;padding:0;position:absolute;left:10px;top:42px;width:71px;height:16px;text-align:left;z-index:2;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Vorname:</span></div>
<input type="text" id="Vorname" style="position:absolute;left:91px;top:42px;width:198px;height:18px;border:1px #C0C0C0 solid;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:3" name="Vorname" value=""/>
<div id="wb_Text3" style="margin:0;padding:0;position:absolute;left:10px;top:67px;width:71px;height:16px;text-align:left;z-index:4;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Nachname:</span></div>
<input type="text" id="Nachname" style="position:absolute;left:91px;top:67px;width:198px;height:18px;border:1px #C0C0C0 solid;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:5" name="Nachname" value=""/>
<div id="wb_Text4" style="margin:0;padding:0;position:absolute;left:10px;top:92px;width:71px;height:16px;text-align:left;z-index:6;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">EMail:</span></div>
<input type="text" id="Email" style="position:absolute;left:91px;top:92px;width:198px;height:18px;border:1px #C0C0C0 solid;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:7" name="Email" value=""/>
<div id="wb_Text5" style="margin:0;padding:0;position:absolute;left:10px;top:117px;width:71px;height:16px;text-align:left;z-index:8;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Betreff:</span></div>
<input type="text" id="Betreff" style="position:absolute;left:91px;top:117px;width:198px;height:18px;border:1px #C0C0C0 solid;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:9" name="Betreff" value=""/>
<div id="wb_Text6" style="margin:0;padding:0;position:absolute;left:10px;top:142px;width:71px;height:16px;text-align:left;z-index:10;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Nachricht:</span></div>
<textarea name="Nachricht" id="Nachricht" style="position:absolute;left:91px;top:142px;width:198px;height:98px;border:1px #C0C0C0 solid;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:11" rows="5" cols="27"></textarea>
<div id="wb_Text7" style="margin:0;padding:0;position:absolute;left:10px;top:247px;width:71px;height:16px;text-align:left;z-index:12;">
<span style="color:##C0C0C0;font-family:Arial;font-size:13px;">Captcha:</span></div>
<div id="wb_Captcha1" style="margin:0;padding:0;position:absolute;left:91px;top:247px;width:198px;height:36px;text-align:left;z-index:13;">
<img src="captcha1.php" alt="Click for new image" title="Click for new image" style="cursor:pointer;width:100px;height:38px;" onclick="this.src='captcha1.php?'+Math.random()"/>
<input type="text" id="Captcha1Edit" style="position:absolute;left:105px;top:18px;width:98px;height:18px;border:1px #C0C0C0 solid;background-color:transparent;font-family:Arial;font-size:13px;" name="captcha_code" value=""/></div>
<input type="submit" id="Button1" name="" value="Submit" style="position:absolute;left:91px;top:290px;width:96px;height:25px;background-color:transparent;color:#C0C0C0;font-family:Arial;font-size:13px;z-index:14"/>
</form>
</div>
</div>
</body>
</html>
liegt im Unterordner kontakt.
Nun soll diese via
Code:
<?php
include_once ('kontakt/index.php');
?>
Hier die Datei in der die einzufügene Datei eingebunden werden soll
Code:
<!doctype html> <!-- [en:] HTML>=5 'doctype' (as recommended!)-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>AFD-Industries ::: afd-ind.com ::: home </title>
<link rel="stylesheet" type="text/css" href="afd.css" />
<link rel="shortcut icon" href="imgs/icons/animated/A-F-D_iconimation_lightgrey_on_black_003c_press_F11_16x16.gif" />
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<!-- Für script.aculo.us benötigte JavaScript-Dateien einbinden -->
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/lib/prototype.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/scriptaculous.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/builder.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/controls.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/dragdrop.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/effects.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/slider.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/sound.js"></script>
<script type="text/javascript" src="./function/scriptaculous-js-1.9.0/src/unittest.js"></script>
<script type="text/javascript" src="afd.js"></script>
</head>
<body>
<!-- [de:] Container zum Anwenden von Animationen, um den gesamten Inhalt abblenden oder einblenden zu können::: -->
<!--
<div class="curtain" id="curtain_00">
<a id="welcome" href="#" onClick="curtainLift();">
<img id="startlogo" src="./imgs/logo/afd_-_logo._fady_white._000.png" alt="AFD - click to enter!">
<p class="message" /> THIS IS AFD!<br />
WELCOME!!</p>
</a>
</div>
-->
<div class="stage">
<div class="focus">
<div class="structure">
<img id="logo_AFD" src="./imgs/AFD_-_logo._corner_top-left_.-240x149._000.png" />
<div class="info_announce">
<span class="superfat">THIS IS AFD!</span>
</div>
<div class="clear"></div>
<div class="infobar">Angemeldet als USERname... </div>
<div class="navigation_top">
<a class="menubutton_top" href="index.php">Home</a>
<a class="menubutton_top" href="about.php">This is AFD!</a>
<a class="menubutton_top" href="blog/index.php">Blog</a>
<a class="menubutton_top" href="xtcommerce/index.php?cPath=4_5">Shop</a>
<a class="menubutton_top" href="xtcommerce/shop_content.php?coID=7">Contact</a>
<div class="locale">
<a href="xtcommerce/index.php?language=de&cPath=4_5">
<img src="imgs/icon_ger.gif" alt="Deutsch" width="18" height="12" />
</a>
<a href="xtcommerce/index.php?language=en&cPath=4_5">
<img src="imgs/icon_eng.gif" alt="English" width="18" height="12" />
</a>
</div>
</div>
<div class="content_kontakt">
<?php
include_once ('kontakt/index.php');
?>
</div>
<div class="foot">
<?php require_once 'includes/footer.inc.php';?>
</div>
</div>
</div>
</div>
</body>
</html>
Mein Problem ist das die Datei nicht angezeigt wird. Also wenn Sie eingebunden ist wird sie im Browser nicht angezeigt.
Habt Ihr einen Rat?.
Danke