Hallo da ich nicht genau weiß wie dir das erklären soll habe ich mal die Datei kopiert. Ich hoffe das es was nutzt, einige Passagen sind in portugiesischer Sprache, ist aber nur Text.
Gruß
ulagos
require('./includes/config.inc.php');
require('./includes/messages.inc.php');
//--Auktions-ID aus der Sessionvariablen holen
$auction_id = $sessionVars["CURRENT_ITEM"];
if ($REQUEST_METHOD=="GET")
{
$TPL_id_value = $auction_id;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
else
{
/*
Check Username/Pssword
Wenn OK : eMail senden
Wenn nicht OK : Formular samt Fehlermeldung noch einmal anzeigen
*/
if(!$nick || !$password || !$TPL_text)
{
$TPL_error_text = $ERR_031;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
else
{
// Diverse Daten "zusammensammeln"
$query = "select email from users where id='$user_id'";
$result = mysql_query($query);
if(!$result)
{
// Datenbankzugriffsfehler
$TPL_error_text = $ERR_001;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
else
{
// eMail-Adresse des Verkäufers
$email = mysql_result($result,0,"email");
}
$query = "select nick,password,email,name from users where nick='$nick'";
$result = mysql_query($query);
if(!$result)
{
// Datenbankzugriffsfehler
$TPL_error_text = $ERR_001;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
else
{
if(mysql_num_rows($result) == 0)
{
// Benutzer existiert nicht
$TPL_error_text = $ERR_100;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
// Fragender: eMail-Adresse
$from_email = mysql_result($result,0,"email"); // Soll nicht angezeigt werden
// Fragender: Passwort
$bm_password = mysql_result($result,0,"password");
// Fragender: Username
$bm_nick = mysql_result($result,0,"nick");
// Fragender: vollständiger Name
$name = mysql_result($result,0,"name");
// Passwort
prüfen
if ($bm_password != md5($MD5_PREFIX.$password))
{
// Falsches Passwort
$TPL_error_text = $ERR_101;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
}
// Artikel-Titel holen
$bm_query = "select title from auctions where id='$auction_id'";
$bm_result = mysql_query($bm_query);
if(!$bm_result)
{
// Datenbankzugriffsfehler
$TPL_error_text = $ERR_001;
include "header.php";
include "templates/template_email_request_form.html";
include "footer.php";
exit;
}
else
{
$bm_title = mysql_result($bm_result,0,"title");
}
// eMail-Body erstellen (sollte noch parametrisiert werden...)
$bm_text = "";
$bm_text = "Um outro utilizador tem uma pergunta sobre seu leilão\n";
$bm_text .= "****************************************************\n\n";
$bm_text .= "Nº do leilão. : ".$auction_id."\n";
$bm_text .= "Título : ".$bm_title."\n";
$bm_text .= "Link ao leilão:\n";
$bm_text .= $SITE_URL."item.php?id=".$auction_id."\n\n";
$bm_text .= $TPL_text."\n\n";
$bm_text .= "****************************************************\n";
$bm_text .= "Se você recebeu este e-mail de erro\n";
$bm_text .= "faz favor escreva para $adminEmail.\n\n";
$bm_text .= "";
$from = "From: $name <$from_email>\n";
$subject = "$SITE_NAME: Pergunta ao Licitador - Leilão-Nº. $auction_id";
// Und abschicken das Ding!
mail($email, $subject, $bm_text, $from);
// Bestätigungsseite anzeigen
include "header.php";
include "templates/template_email_request_result.html";
include "footer.php";
exit;
}
}
?>