 |
| Hinweise |
Willkommen im TP-Hilfe-Forum!Dies ist ein Forum zu den Themen Photoshop, Dreamweaver, Flash, Selbständigkeit und mehr, in dem Du Hilfe, Anleitung oder eine Lösung zu Deinen Problemen erhältst. Aktuell bist Du in unseren Foren als Gast mit reinen Leserechten unterwegs. Wenn Du Dich registrierst, kannst Du eigene Themen verfassen, Deine Frage stellen und privat mit anderen TPlern kommunizieren. Weitere Foren werden zugänglich, und Du wirst – falls gewünscht – per Mail über neue Beiträge informiert. Die Registrierung ist schnell und kostenlos. Sollten bei der Registrierung Fragen auftauchen, reicht ein Klick in unsere Hilfe - Häufig gestellte Fragen oder eine kurze Mitteilung an das Support-Team. Viel Spaß bei Traum-Projekt.com |
20.05.2005, 19:46
|
#1
|
|
TP-Member
Registriert seit: Aug 2003
Ort: Deutschland
|
weiterleitung einbauen...
hallo leute,
ich habe hier ein script installiert. das als empfählung den link per email verschickt. das iat ja alles ok, nun möchte ich eine weiterleitung einbauen wen man die email abgeschickt hat. das ist der code
PHP-Code:
echo "</center>\n<br>\n<center><b>Danke dass Du unsere Webseite weiterempfohlen hast!</b><br><br>\nKlick <a href=\"$returnPage\" target=\"_self\">here</a> hier "
."wen Du zurück zur Webseite willt. Oder <a href=\"".$_SERVER['PHP_SELF']."?sn=".urlencode($_POST['senderName'])."&se=".urlencode($_POST['senderEmail'])
."\">hier</a> um noch eine <br>Weiterempfehlung abzuschicken!</center><br><br>\n\n";
wie kann man hier eine weiterleitung einbauen ?
mit den meta tag geht es nicht weill auch das formular auf der selben seite ist.
__________________
.........
cu ...
Mr. Eddi
|
|
|
20.05.2005, 21:29
|
#2
|
|
TP-Veteran
Registriert seit: Jun 2004
Ort: Stuttgart
|
Weiterleitungen kannst du mit
header("Location: http://www.irgendwohin.de");
machen. Dabei sollte beachtet werden, dass du entweder nichts ausgibst wenn du weiterleitest oder den Ausgabepuffer aktivierst - mit:
ob_start();
ganz am Anfang deines Scripts.
|
|
|
20.05.2005, 22:15
|
#3
|
|
TP-Member
Registriert seit: Aug 2003
Ort: Deutschland
|
irgend wie klappt das nicht.
ich pste mal die seite vieleicht kann da mal bitte jemand mir sagen wo ich das mit der weiterleitung einbauen muss.
PHP-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<span class="content">
<?php
/* tell-a-friend 2.1
revision 7 4/18/04
12-31-2003 (c) neoprogrammers.com
Thanks go to the following for beta testing:
-David Catt of CTS Innovations Inc. (www.standready.biz) (addressed register globals issue, textarea edit problem)
-Abeer Ali (idea for send as html option and fixing problems w/ usage notification)
-Roland Munyard (www.soundbyte.co.uk) (use of [REFPAGE] variable to show referring page in message)
I've tried to make configuration easy below but am too lazy to make a true readme file so if you need help
email drew@drew-phillips.com w/ questions.
Enjoy and I hope this script does what you need. :)
*/
//Configuration Below
$homepage = "http://www.deineseite.at";
$numFriends = 3;
//how many form fields for friends' email addresses to show.
$webmasterEmail = "enail@adresse.at";
//your email address, used for sending notifications
$returnPage = "http://deineseite.at";
//after a person sends a message, a link will be shown for them to click in order to
//return to a page on your site. here is where you specify that page.
$sendNotification = 1;
//whether or not to notify you when someone completes the form. 1 for yes, 0 for no
$subject = "Webseiten Empfaehlung [SENDER_NAME] ([SENDER_EMAIL])";
//the subject line of sent messages. [SENDER_NAME] will be replaced with the actual sender name
//and [SENDER_EMAIL] will be replaced with the senders email address.
$useHeader = 0;
$headerFile = "header.html";
//If $useHeader is set to 1, then the file in $headerFile will be included at the top
//of the script as html code. Use this to add colors or include your website's layout
//with this script in the middle. this is an absolute path and can be any file type (.php, .htm)
$useFooter = 0;
$footerFile = "header.html";
//Same as $useHeader except this will appear at the bottom of the recommend script.
$recommendMessage = <<<EOD
Hallo,
schau mal ich habe da eine Webseite gesehen die ist sehr interessant.
Ich dachte Du könntest sie Dir mal anschauen, finde die Webseite:"$homepage" nicht schlecht.
Cu bis bald …
EOD;
//This is the message you, the site owner write that CANNOT be edited by the sender.
//This message will appear to all who receive messages from friends. It is what will
//hopefully get the friend to click to your site (aside from a friend recommending it).
//Start editing on the line AFTER <<<EOD and stop editing before EOD; be sure to leave
//those two lines the way they are or you will receive an error.
//NEW: If you place [REFPAGE] in this text, it will be replaced with the page that the person
//clicked to the tell a friend page from. Good for sites with many pages with different content.
//Keep in mind some browsers hide or change the referring page, so use this at your own risk.
$customMessage = <<<EOD
EOD;
//This is a box that the sender can edit if they wish to enter a personal
//message to their friend if they wish. You can make it say whatever you want
//but make sure they know they can edit it for personalization.
$sendAsHtml = 0;
//Set to 1 to send messages as html (note some email clients can not display html emails and
//will result in the recipient seeing the html code with their message.
$htmlHeader = <<<EOD
<body bgcolor="#E0E0E0" text="#00ff00" link="#0000ff">
<center><b>Recommend Message</b></center><br>
<center><img src="http://www.yoursite.com/logo.png"></center>
<br><br>
EOD;
//the above html will show up at the top of the message to set up
//the colors and anything else you'd like to be in the email. if $sendAsHtml is set to 1
//this will show up in the message, otherwise it wont.
//thats it, nothing else needs to be done. if you had trouble, feel free to email me (drew@drew-phillips.com)
//and ill do my best to help you. if you have any comments or bugs to report, let me know there too please.
###############################################################################################
###############################################################################################
## ##
## END CONFIGURATION - NO NEED TO GO BELOW UNLESS YOU REALLY KNOW WHAT YOU ARE DOING ##
## ##
###############################################################################################
###############################################################################################
error_reporting(E_ERROR); // only stop for critical errors
/* start main */
if(!isset($_POST["action"])) {
if($useHeader) include($headerFile);
show_form();
if($useFooter) include($footerFile);
} else {
//begin error checking
if(trim($_POST['senderName']) == "") {
$error[] = "Ihr Name hat fehlt noch.";
}
$_POST['senderEmail'] = trim($_POST['senderEmail']);
if(!isValid($_POST['senderEmail'])) {
$error[] = "Ihr email address scheint, unzulässig zu sein.";
unset($_POST['senderEmail']);
}
$validRecips = check_valid($_POST['friend']);
if($validRecips == FALSE) {
$error[] = "Emfänger Email Adressen ungültig !.";
}
//end error checking
if($useHeader) include($headerFile);
if($error) {
echo "<center>\n";
foreach($error as $oneError) {
echo "$oneError<br>\n";
}
echo "</center>\n";
echo show_form();
if($useFooter) include($footerFile);
} else { //no error
$subject = str_replace("[SENDER_NAME]", $_POST['senderName'], $subject);
$subject = str_replace("[SENDER_EMAIL]", $_POST['senderEmail'], $subject);
$message = trim($_POST['recommendMessage']) . "\n\n" . $_POST['customMessage'] . "\n\n\n_________________________________________\n"
."Wir weisen noch mal darauf hin, dass es sich bei dieser Mail um keine Spam Mail handelt!."
." Deine Email Adresse ist in keiner Mailliste so das Du keine weitere Email erhalten."
."Wen es doch zu einer Belästigung führen sollte so hast Du hier die IP Adresse des Absenders : " . $_SERVER[REMOTE_ADDR] . "\n"
."Wir freuen und Dich auf unserer Homapage :http://www.deineseite.at begrüssen zu dürfen.\n"
."cu Team Palorx.de.";
echo "<!-- Powered By - Tell A Friend 2.0 (http://www.deineseite.at) -->\n\n";
//Invisible HTML Comment. Take out or leave as you desire.
echo "<center>\n";
if($_POST['toself'] == TRUE) {
array_push($validRecips, $_POST['senderEmail']);
}
$content = ($sendAsHtml == TRUE ? "text/html" : "text/plain");
$message = stripslashes($message);
if($sendAsHtml == 1) $message = $htmlHeader . nl2br(trim($message));
$headers = "From: " . $_POST['senderName'] . " <" . $_POST['senderEmail'] . ">\r\n";
$headers .= "- - - - - - - - - - - - - - - - - - - - - - \r\n";
$headers .= "Webseiten Empfählung von : http://www.deineseite.at\r\n";
$headers .= "Dies ist keine Spam Mail !!\r\n";
$headers .= "- - - - - - - - - - - - - - - - - - - - - - ";
foreach($validRecips as $recip) {
$friends .= $recip . " ";
@mail($recip, $subject, $message, $headers);
echo "Weiterempfehlung abgeschickt an: $recip<br>\n";
}
echo "</center>\n<br>\n<center><b>Danke dass Du unsere Webseite weiterempfohlen hast!</b><br><br>\nKlick <a href=\"$returnPage\" target=\"_self\">hier</a> hier "
."wen Du zurück zur Webseite willt. Oder <a href=\"".$_SERVER['PHP_SELF']."?sn=".urlencode($_POST['senderName'])."&se=".urlencode($_POST['senderEmail'])
."\">hier</a> um noch eine <br>Weiterempfehlung abzuschicken!</center><br><br>\n\n";
if($useFooter) include($footerFile);
if($sendNotification) {
//build message string here.
$nMessage = $_POST['senderName'] . " (" . $_POST['senderEmail'] . ") " . $_SERVER['REMOTE_ADDR'] . " filled out your recommend form on your site and sent to " . count($validRecips) . " friends ($friends).";
@mail($webmasterEmail, "Your site was recommended.", $nMessage, "From: $webmasterEmail");
}
}
}
/* end main */
/* mixed */ function check_valid($list)
{
global $errorCode;
$numElements = sizeof($list);
$goodEmails = array();
foreach($list as $single) {
if(isValid($single)) {
$goodEmails[] = $single;
}
}
if(!empty($goodEmails)) {
return array_unique($goodEmails);
} else {
return FALSE;
}
}
/* void */ function show_form()
{
global $numFriends, $validRecips, $recommendMessage, $customMessage;
$senderName = (!isset($_GET['sn']) ? $_POST['senderName'] : urldecode($_GET['sn']));
$senderEmail = (!isset($_GET['se']) ? $_POST['senderEmail'] : urldecode($_GET['se']));
//just assign the sender vars either their get value(if set) otherwise the post val, even if blank
echo "<!-- Powered By - Tell A Friend 2.0 (http://www.neoprogrammers.com) -->\n\n";
//Invisible HTML Comment. Take out or leave as you desire.
echo "<form method=\"POST\" action=\"".$_SERVER['PHP_SELF']."\">\n"
."<input type=\"hidden\" name=\"action\" value=\"submit\">\n"
."<table border=0 align=\"center\" cellpadding=5 cellspacing=0>\n"
."\t<tr>\n"
."\t\t<td>Dein Namen</td><td><input type=\"text\" name=\"senderName\" value=\"$senderName\" size=30></td>\n"
."\t</tr>\n"
."\t<tr>\n"
."\t\t<td>Deine Email Adresse</td><td><input type=\"text\" name=\"senderEmail\" value=\"$senderEmail\" size=30></td>\n"
."\t</tr>\n";
for($i = 1; $i <= $numFriends; $i++) {
echo "\t<tr>\n\t\t<td>Freund $i:</td><td><input type=\"text\" name=\"friend[]\" value=\"".$validRecips[$i - 1]."\" size=30></td>\n\t</tr>\n";
}
if (strpos($recommendMessage, "[REFPAGE]") !== FALSE) {
if (!isset($_SERVER['HTTP_REFERER']))
$recommendMessage = str_replace("[REFPAGE]", "(Referrer Unavailable)", $recommendMessage);
else
$recommendMessage = str_replace("[REFPAGE]", $_SERVER['HTTP_REFERER'], $recommendMessage);
}
echo "\t<tr>\n"
."\t\t<td colspan=2><textarea name=\"recommendMessage\" cols=47 rows=5 readonly onFocus=\"this.blur()\">$recommendMessage</textarea></td>\n"
."\t</tr>\n"
."\t<tr>\n"
."\t\t<td colspan=2><textarea name=\"customMessage\" cols=47 rows=5>$customMessage</textarea></td>\n"
."\t</tr>\n"
."\t<tr>\n\t\t<td colspan=2><input type=\"checkbox\" name=\"toself\"> Wen Du eine Kopie der Email willst setze hier den Hacken !</td>\n\t</tr>\n"
."\t<tr>\n\t\t<td colspan=2><input type=\"submit\" value=\"Send Message\"> <input type=\"reset\" value=\"Clear Form\"></td>\n\t</tr>\n"
."\t<tr>\n\t\t<td colspan=2><font size=1>Deine IP Adresse wird mit gesendet, machen also kein Spam damit..!</font></td>\n\t</tr>\n"
."</table>\n"
."</form>\n\n";
}
/* bool */ function isValid($email)
{
return eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$", $email);
}
?>
</span>
</body>
</html>
das ist die ganze seite, nun weiss ich aber nicht wo ich da eineweiterleitung einbauen kann. wen ich sie normal einbaue, so wird schon weitergeleitet wen die seite aufgerufen wird. es soll aber erst weitergeleitet werden nach den abschicken des formulars. vieliecht weiss jemand da einen rat.
möchte mich schon mal bedanke ... THX
__________________
.........
cu ...
Mr. Eddi
|
|
|
20.05.2005, 23:38
|
#4
|
|
TP-Special Mod
Registriert seit: Feb 2005
Ort: Haan / NRW
|
da Du nach dem mailen Text ausgeben willst, solltest Du das mit Javascript machen.
Hier kannst Du z.B. nach 5 sek. die Weiterleitung machen:
PHP-Code:
...
foreach($validRecips as $recip) {
$friends .= $recip . " ";
@mail($recip, $subject, $message, $headers);
echo "Weiterempfehlung abgeschickt an: $recip<br>\n";
}
echo "</center>\n<br>\n<center><b>Danke dass Du unsere Webseite weiterempfohlen hast!</b>";
if($useFooter) include($footerFile);
if($sendNotification) {
//build message string here.
$nMessage = $_POST['senderName'] . " (" . $_POST['senderEmail'] . ") " . $_SERVER['REMOTE_ADDR'] . " filled out your recommend form on your site and sent to " . count($validRecips) . " friends ($friends).";
@mail($webmasterEmail, "Your site was recommended.", $nMessage, "From: $webmasterEmail");
}
?>
<script language="JavaScript" type="text/javascript">
setTimeout("document.location.href='nextpage.php'",5000)
</script>
<?php
}
}
/* end main */
...
|
|
|
21.05.2005, 00:03
|
#5
|
|
TP-Member
Registriert seit: Aug 2003
Ort: Deutschland
|
danke für deine hilfe.
ich habe mir nicht so richtig getraut da so ein script ein zusetzen. dachte ich muss es irgend wie mit php lösen.
ich bedanke mich bei dir DANKE !!
__________________
.........
cu ...
Mr. Eddi
|
|
|
21.05.2005, 00:15
|
#6
|
|
TP-Special Mod
Registriert seit: Feb 2005
Ort: Haan / NRW
|
kein Problem
Du solltest halt auch schreiben, das weitergeleitet wird und zur Sicherheit den Link fürs weiterleiten ausgeben, wenn JS ausgeschaltet ist.
|
|
|
21.05.2005, 00:30
|
#7
|
|
TP-Member
Registriert seit: Aug 2003
Ort: Deutschland
|
habe ich schon getan danke das du mich daran erinnert hast !!!
dank noch mal ....
__________________
.........
cu ...
Mr. Eddi
|
|
|
|
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
|
|
|
| Themen-Optionen |
Thema durchsuchen |
|
|
|
| Thema bewerten |
|
|
Forumregeln
|
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.
HTML-Code ist aus.
|
|
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:40 Uhr.
|
 |