|
||||||||||||
Ver. 11.Ein Fehler ist aufgetreten.Bitte wenden Sie sich an den Site-Administrator. Fehlercode: 103 "); }}?> Ein Fehler ist aufgetreten. Bitte wenden Sie sich an den Site-Administrator.Fehlercode: $code "; die(); } $gbpath = "../guestbook"."/" ; $separateForm = false; $topForm = true; $notifyWebmaster = true; $notifyEmail = "jyoung@johnyoung-online.com"; $showtime = true; $emoticons = true; $smtpip = "smtp.johnyoung-online.com"; $separator = '|'; $gbfile = $gbpath.'entries.dat'; // predefine variable values $myVars['pass'] = ''; $myVars['name'] = ''; $myVars['email'] = ''; $myVars['homepage'] = ''; $myVars['city'] = ''; $myVars['state'] = ''; $myVars['country'] = ''; $myVars['comment'] = ''; $myVars['op'] = ''; // working variables initialisation function gbInitParameterVariables($array, &$target) { if (!is_array($array)) { return FALSE; } $is_magic_quotes = get_magic_quotes_gpc(); foreach ($array AS $key => $value) { if (is_array($value)) { unset($target[$key]); gbInitParameterVariables($value, $target[$key]); } else if ($is_magic_quotes) { $target[$key] = stripslashes($value); } else { $target[$key] = $value; } } return TRUE; } if(!empty($_GET))gbInitParameterVariables($_GET, $myVars); if(!empty($_POST)) gbInitParameterVariables($_POST, $myVars); $op = $myVars['op']; if ($op == "add") { //data curenta $data = date("l F j Y g:i:s A"); $name = $myVars['name']; $email = $myVars['email']; $homepage = $myVars['homepage']; $city = $myVars['city']; $state = $myVars['state']; $country = $myVars['country']; $comment = $myVars['comment']; $array = array("$name", "$email", "$homepage", "$city","$state", "$country", "$data", "$comment"); $full = implode($separator, $array); //ptr a inlocui taguri, enter, ghilimele, spatiu $tmp = $full; $tmp = str_replace('<', "<", $tmp); $tmp = str_replace('>', ">", $tmp); $tmp = str_replace("\r\n", "", $tmp); $tmp = str_replace("\n", " ", $tmp); $tmp = str_replace('"', '"', $tmp); //scriu in fisier tot sirul $fp = @fopen($gbfile, 'a+') or gbThrowError(532); flock($fp, LOCK_EX); fwrite($fp, $tmp. "\r\n"); flock($fp, LOCK_UN); fclose($fp); if ($notifyWebmaster) { $message = "Hallo, es wurde ein neuer Eintrag in Ihrem Gästebuch vorgenommen.\n"; $message .= "Name: ".$name."\n"."Kommentar: ".$comment; if (!file_exists('mailer.inc.php')) { gbThrowError(103); } include_once("mailer.inc.php"); $mail = new PHPMailer(); $mail->From = $notifyEmail; $mail->FromName = "Gästebuch"; $mail->Host = $smtpip; $mail->SMTPDebug = false; $mail->Mailer = "smtp"; $mail->Subject = "Neuer Gästebucheintrag"; $mail->CharSet = "utf-8"; $mail->SMTPAuth = false; $mail->IsHTML = true; $mail->AddAddress($notifyEmail,$notifyEmail); $mail->Body = $message; // send e-mail if (!$mail->Send()) { $mail->Mailer = "mail"; if (!$mail->Send()) { $mail->Mailer = "sendmail"; $mail->Send(); } } // done! clean up $mail->ClearAddresses(); $mail->ClearAttachments(); } $me = $_SERVER['PHP_SELF']; echo ""; } ?> GästebuchKommentar hinzufügen"; } if (!$separateForm && $topForm) { include_once("addguest.php"); } if (!file_exists($gbfile)){ if(!$FILE = @fopen($gbfile, 'w')){ gbThrowError(530); } } //citesc intregul fisier //fiecare linie devine un element din tabloul $lines $lines = file($gbfile); $line_num = count($lines); //construiesc un element din guestbook for ($i = $line_num-1; $i >= 0; $i--) { if (trim($lines[$i]) != "") { $sir = explode($separator, $lines[$i]); for ($k = 7; $k >= 0; $k--) $sir[$k] = trim($sir[$k]); echo ""; echo " ";
echo "Name: ".$sir[0]." ".$sir[7]." "; } }; echo ""; if (!$separateForm && !$topForm) { include_once("addguest.php"); } ?> 05 |
||||||||||||