help with the ecard php

This is a discussion on help with the ecard php within the PHP Language forums, part of the PHP Programming Forums category; wer kann mir mit diesem php - teil helfen .. es scheint nicht zu funktionnieren .. das problem müsste im unteren teil ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-05-2003
andi.z
 
Posts: n/a
Default help with the ecard php

wer kann mir mit diesem php - teil helfen .. es scheint nicht zu
funktionnieren .. das problem müsste im unteren teil zu suchen sein,
nach den tabellen ..


<html>

<head>

<title>andimation.ch</title>

<style type="text/css">

<!--
td { color: black; font-style: normal; font-weight: normal;
font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
none }
a:link { color: deeppink; font-style: normal; font-weight: normal;
font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
none }
a:hover { color: white; font-style: normal; font-weight: normal;
font-size: 10px; font-family: "Arial", Arial, Arial;
background-color:dodgerblue}
a:visited { color: silver; font-style: normal; font-weight: normal;
font-size: 10px; font-family: "Arial", Arial, Arial;
background-color:pink}
p { color: black; font-style: normal; font-weight: normal;
font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
none }
-->
</style>

</head>

<body>

<center>

<table>
<colgroup width="80">
</colgroup>
<tr>
<td align="center">

<?php
require("include.php");
if (!isset($send) and !isset($preview)){ ?>
<form name="form1" method="post" action="index.php">
<img src="b.jpg" width="157" height="212"
border="0"></a>
<br>
<input type="radio" name="bild" value="b.jpg" checked>
</td>

<td align="center">
<img src="b.jpg" width="157" height="212" border="0"></a>
<br>
<input type="radio" name="bild"
value="b.jpg">
</td>

<td align="center">
<img src="b.jpg" width="157" height="212" border="0"></a>
<br>
<input type="radio" name="bild"
value="b.jpg">
</td>
</tr>
</table>

<br><br>

<table>
<tr>
<td align="center"><p>ihre nachricht:</td>
</tr>
<tr>
<td align="center"><textarea name="nachricht" cols="40"
rows="6"></textarea></td>

</tr>
</table>

<br><br>

<table>
<tr>
<td align="center"><p>absenderemail:</td>
<td align="center"><input type="text" name="absenderemail"></td>
</tr>
<tr>
<td align="center"><p>empfaengeremail:</td>
<td align="center"><input type="text"
name="empfaengeremail"></td>
</tr>
</table>

<br><br>

<a href="index.php?preview=1"
onClick="MM_openBrWindow('index.php?preview=1','', 'toolbar=yes,status=yes,menubar=yes,scrollbars=yes ,resizable=yes,width=800,height=600')"></a>

<input name="imageField2" type="image" src="vorschau.gif" width="140"
height="24" border="0">
<input name="preview" type="hidden" id="preview" value="1">

</center>

<?php }
else
{
require("include.php");
if (empty ($absenderemail)) {
die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte Ihre Emailadresse ein.<br><br><a
href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$",
$absenderemail)) {
die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte eine gültige Absender-Emailadresse an.
<br><br><a href=\"javascript:history.go(-1);\">&laquo;&laquo;
zurück</A></font>");}
if (empty ($empfaengeremail)) {
die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte die Emailadresse des Empfängers
ein.<br><br><a href=\"javascript:history.go(-1);\">
&laquo;&laquo; zurück</A>");}
if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$",
$empfaengeremail)) {
die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte eine gültige Empfänger-Emailadresse an.
<br><br><a href=\"javascript:history.go(-1);\">&laquo;&laquo;
zurück</A></font>");}
if (empty ($absendername)) {
die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte Ihren Namen ein.<br><br><a
href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
if (empty ($empfaengername)) {
die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
color=red>Geben Sie bitte den Namen des Empfängers ein.<br><br><a
href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
if($send=="1")
{
//Unix-Zeit festlegen
$unixtime = time();
$ablaufdatum = "$unixtime"+"$zeitspanne";

//Templatedatei öffnen und füllen
$templatefile = fopen ($template, "r");
if (!$templatefile) {
echo "<p>Kann Vorlagendatei nicht finden.";}
$html = fread ($templatefile, filesize ($template));
fclose ($templatefile);
$nachricht = stripslashes($nachricht);
//Daten ins Template einfügen
$html = ereg_replace("%absenderemail%","$absenderemail",$h tml);
$html = ereg_replace("%empfaengeremail%","$empfaengeremail ",$html);
$html = ereg_replace("%bild%","$bild",$html);
$html = ereg_replace("%nachricht%","$nachricht",$html);

//Karte abspeichern
$datei = fopen("$ablaufdatum".".html", "w+");
if ($datei)
{
fputs ($datei,"$html");
fclose ($datei);
}

$db = "daten.txt";
$daten= fopen ("$db","a+");
if (flock($daten,2)){
fputs ($daten, "$ablaufdatum".";\n");
fclose ($daten);}

//Empfänger benachrichtigen
$link = "$kartenverzeichnis"."card.php?id=$ablaufdatum ";
//Email-Nachrichtentext festlegen
$emailtext = "
Hallo $empfaengeremail,
$absenderemail ($absenderemail) hat ihnen / dir eine virtuelle karte
geschickt.
klicken Sie / du bitte auf folgenden link:
------------------------------------------------------
$link
------------------------------------------------------
die karte wird 14 tage für Sie / dich bereit liegen.

herzlichst

$homepageurl\n";
$betreff = "von $absenderemail: karte für $empfaengeremail";
mail("$empfaengeremail", "$betreff", "$emailtext","From:
$absenderemail");

//Bildschirmrückmeldung
$feedback ="<table width=\"100%\" border=\"0\" cellspacing=\"1\"
cellpadding=\"2\">
<tr>
<td width=\"9%\"> </td>
<td width=\"91%\"> </td>
</tr>
<tr>
<td width=\"9%\"> </td>
<td width=\"91%\" bgcolor=\"#F4F4F4\"><font face=\"Arial,
Helvetica, sans-serif\" size=\"2\"><b>hallo
$absenderemail</b></font></td>
</tr>
<tr>
<td width=\"9%\"> </td>
<td width=\"91%\">
<p><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">ihre
karte
an <b>$empfaengeremail ($empfaengeremail)</b> wurde
abgeschickt.<br>
die karte wird 14 tage zur abholung bereitliegen</font></p>
</td>
</tr>
</table>
";
echo $feedback;
readfile("$ablaufdatum".".html");
//Abgelaufene Dateien löschen
$ziffernzeilen = file($db);
while (list ($line_num, $line) = each ($ziffernzeilen))
{ $ziffern = explode(";",$line);

//Abgelaufene Zeilen suchen
if ("$ziffern[0]" < "$unixtime")
{$nummer = $line_num;
$delete = "$ziffern[0]".".html";
@unlink($delete);

$fp = fopen( "$db", "r" );
$size = filesize($db);
$contents = fread($fp, $size);
fclose($fp);

$string2 = "";
if ($line_num == $nummer){
$replace = ereg_replace($line, $string2, $contents);

$fp = fopen($db, "w");
fputs($fp, $replace, $size);
fclose($fp);}
}
}}
if($preview==1)
{
//Templatedatei öffnen und füllen
$templatefile = fopen ($templatevorschau, "r");
if (!$templatefile) {
echo "<p>Kann Vorlagendatei nicht finden.";}
$html = fread ($templatefile, filesize ($templatevorschau));
fclose ($templatefile);
$nachricht = stripslashes($nachricht);
$nachricht = htmlentities($nachricht, ENT_QUOTES);

//Daten ins Template einfügen
$html = ereg_replace("%absenderemail%","$absenderemail",$h tml);
$html = ereg_replace("%empfaengeremail%","$empfaengeremail ",$html);
$html = ereg_replace("%bild%","$bild",$html);
$html = ereg_replace("%nachricht%","$nachricht",$html);
echo "$html";
}

}

?>
</td>
</tr>
</table>
</body>
</html>
Reply With Quote
  #2 (permalink)  
Old 08-06-2003
matty
 
Posts: n/a
Default Re: help with the ecard php

andi.z wrote:

> wer kann mir mit diesem php - teil helfen .. es scheint nicht zu
> funktionnieren .. das problem müsste im unteren teil zu suchen sein,
> nach den tabellen ..
>
>


Hier ist ein Englischsparchiges newsgroup; vielleicht wenn Sie auf Englisch
fragen, koennten mehre Leuten hilfen...

Auch, Sie sollten erklaren wenig general sein - nicht "Es funktionniert nicht",
sonder "Es macht x und y, aber es soll p und q machen"....
Reply With Quote
  #3 (permalink)  
Old 08-07-2003
andi.z
 
Posts: n/a
Default Re: help with the ecard php

andreas.z@bluewin.ch (andi.z) wrote in message news:<53a188c9.0308051358.76080507@posting.google. com>...


who can help me with this php-code. the first part is all right.

> <html>
>
> <head>
>
> <title>andimation.ch</title>
>
> <style type="text/css">
>
> <!--
> td { color: black; font-style: normal; font-weight: normal;
> font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
> none }
> a:link { color: deeppink; font-style: normal; font-weight: normal;
> font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
> none }
> a:hover { color: white; font-style: normal; font-weight: normal;
> font-size: 10px; font-family: "Arial", Arial, Arial;
> background-color:dodgerblue}
> a:visited { color: silver; font-style: normal; font-weight: normal;
> font-size: 10px; font-family: "Arial", Arial, Arial;
> background-color:pink}
> p { color: black; font-style: normal; font-weight: normal;
> font-size: 10px; font-family: "Arial", Arial, Arial; text-decoration:
> none }
> -->
> </style>
>
> </head>
>
> <body>
>
> <center>
>
> <table>
> <colgroup width="80">
> </colgroup>
> <tr>
> <td align="center">
>
> <?php
> require("include.php");
> if (!isset($send) and !isset($preview)){ ?>
> <form name="form1" method="post" action="index.php">
> <img src="b.jpg" width="157" height="212"
> border="0"></a>
> <br>
> <input type="radio" name="bild" value="b.jpg" checked>
> </td>
>
> <td align="center">
> <img src="b.jpg" width="157" height="212" border="0"></a>
> <br>
> <input type="radio" name="bild"
> value="b.jpg">
> </td>
>
> <td align="center">
> <img src="b.jpg" width="157" height="212" border="0"></a>
> <br>
> <input type="radio" name="bild"
> value="b.jpg">
> </td>
> </tr>
> </table>
>
> <br><br>
>
> <table>
> <tr>
> <td align="center"><p>ihre nachricht:</td>
> </tr>
> <tr>
> <td align="center"><textarea name="nachricht" cols="40"
> rows="6"></textarea></td>
>
> </tr>
> </table>
>
> <br><br>
>
> <table>
> <tr>
> <td align="center"><p>absenderemail:</td>
> <td align="center"><input type="text" name="absenderemail"></td>
> </tr>
> <tr>
> <td align="center"><p>empfaengeremail:</td>
> <td align="center"><input type="text"
> name="empfaengeremail"></td>
> </tr>
> </table>
>
> <br><br>
>
> <a href="index.php?preview=1"
> onClick="MM_openBrWindow('index.php?preview=1','', 'toolbar=yes,status=yes,menubar=yes,scrollbars=yes ,resizable=yes,width=800,height=600')"></a>
>
> <input name="imageField2" type="image" src="vorschau.gif" width="140"
> height="24" border="0">
> <input name="preview" type="hidden" id="preview" value="1">
>
> </center>



till here:

here it shows the source in the window. but i want to click on the
button to open the preview. i think maybe the following part is at the
wrong place ..



>
> <?php }
> else
> {
> require("include.php");
> if (empty ($absenderemail)) {
> die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte Ihre Emailadresse ein.<br><br><a
> href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
> if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$",
> $absenderemail)) {
> die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte eine gültige Absender-Emailadresse an.
> <br><br><a href=\"javascript:history.go(-1);\">&laquo;&laquo;
> zurück</A></font>");}
> if (empty ($empfaengeremail)) {
> die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte die Emailadresse des Empfängers
> ein.<br><br><a href=\"javascript:history.go(-1);\">
> &laquo;&laquo; zurück</A>");}
> if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$",
> $empfaengeremail)) {
> die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte eine gültige Empfänger-Emailadresse an.
> <br><br><a href=\"javascript:history.go(-1);\">&laquo;&laquo;
> zurück</A></font>");}
> if (empty ($absendername)) {
> die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte Ihren Namen ein.<br><br><a
> href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
> if (empty ($empfaengername)) {
> die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"
> color=red>Geben Sie bitte den Namen des Empfängers ein.<br><br><a
> href=\"javascript:history.go(-1);\">&laquo;&laquo; zurück</A>");}
> if($send=="1")
> {
> //Unix-Zeit festlegen
> $unixtime = time();
> $ablaufdatum = "$unixtime"+"$zeitspanne";
>
> //Templatedatei öffnen und füllen
> $templatefile = fopen ($template, "r");
> if (!$templatefile) {
> echo "<p>Kann Vorlagendatei nicht finden.";}
> $html = fread ($templatefile, filesize ($template));
> fclose ($templatefile);
> $nachricht = stripslashes($nachricht);
> //Daten ins Template einfügen
> $html = ereg_replace("%absenderemail%","$absenderemail",$h tml);
> $html = ereg_replace("%empfaengeremail%","$empfaengeremail ",$html);
> $html = ereg_replace("%bild%","$bild",$html);
> $html = ereg_replace("%nachricht%","$nachricht",$html);
>
> //Karte abspeichern
> $datei = fopen("$ablaufdatum".".html", "w+");
> if ($datei)
> {
> fputs ($datei,"$html");
> fclose ($datei);
> }
>
> $db = "daten.txt";
> $daten= fopen ("$db","a+");
> if (flock($daten,2)){
> fputs ($daten, "$ablaufdatum".";\n");
> fclose ($daten);}
>
> //Empfänger benachrichtigen
> $link = "$kartenverzeichnis"."card.php?id=$ablaufdatum ";
> //Email-Nachrichtentext festlegen
> $emailtext = "
> Hallo $empfaengeremail,
> $absenderemail ($absenderemail) hat ihnen / dir eine virtuelle karte
> geschickt.
> klicken Sie / du bitte auf folgenden link:
> ------------------------------------------------------
> $link
> ------------------------------------------------------
> die karte wird 14 tage für Sie / dich bereit liegen.
>
> herzlichst
>
> $homepageurl\n";
> $betreff = "von $absenderemail: karte für $empfaengeremail";
> mail("$empfaengeremail", "$betreff", "$emailtext","From:
> $absenderemail");
>
> //Bildschirmrückmeldung
> $feedback ="<table width=\"100%\" border=\"0\" cellspacing=\"1\"
> cellpadding=\"2\">
> <tr>
> <td width=\"9%\"> </td>
> <td width=\"91%\"> </td>
> </tr>
> <tr>
> <td width=\"9%\"> </td>
> <td width=\"91%\" bgcolor=\"#F4F4F4\"><font face=\"Arial,
> Helvetica, sans-serif\" size=\"2\"><b>hallo
> $absenderemail</b></font></td>
> </tr>
> <tr>
> <td width=\"9%\"> </td>
> <td width=\"91%\">
> <p><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">ihre
> karte
> an <b>$empfaengeremail ($empfaengeremail)</b> wurde
> abgeschickt.<br>
> die karte wird 14 tage zur abholung bereitliegen</font></p>
> </td>
> </tr>
> </table>
> ";
> echo $feedback;
> readfile("$ablaufdatum".".html");
> //Abgelaufene Dateien löschen
> $ziffernzeilen = file($db);
> while (list ($line_num, $line) = each ($ziffernzeilen))
> { $ziffern = explode(";",$line);
>
> //Abgelaufene Zeilen suchen
> if ("$ziffern[0]" < "$unixtime")
> {$nummer = $line_num;
> $delete = "$ziffern[0]".".html";
> @unlink($delete);
>
> $fp = fopen( "$db", "r" );
> $size = filesize($db);
> $contents = fread($fp, $size);
> fclose($fp);
>
> $string2 = "";
> if ($line_num == $nummer){
> $replace = ereg_replace($line, $string2, $contents);
>
> $fp = fopen($db, "w");
> fputs($fp, $replace, $size);
> fclose($fp);}
> }
> }}
> if($preview==1)
> {
> //Templatedatei öffnen und füllen
> $templatefile = fopen ($templatevorschau, "r");
> if (!$templatefile) {
> echo "<p>Kann Vorlagendatei nicht finden.";}
> $html = fread ($templatefile, filesize ($templatevorschau));
> fclose ($templatefile);
> $nachricht = stripslashes($nachricht);
> $nachricht = htmlentities($nachricht, ENT_QUOTES);
>
> //Daten ins Template einfügen
> $html = ereg_replace("%absenderemail%","$absenderemail",$h tml);
> $html = ereg_replace("%empfaengeremail%","$empfaengeremail ",$html);
> $html = ereg_replace("%bild%","$bild",$html);
> $html = ereg_replace("%nachricht%","$nachricht",$html);
> echo "$html";
> }
>
> }
>
> ?>
> </td>
> </tr>
> </table>
> </body>
> </html>

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0