Hvad er der galt her!
Hvad er der galt her:<html>
<head>
<title>PHPCards - Version 0.2</title>
</head>
<body>
<?php
$cardfile= \"cards/cardfile.txt\"; // Text file for saving cards
// Counter Script
$free=0;
$empty= \"empty\\n\";
$oldcards = file($cardfile);
$total = count($oldcards);
for($i = 0 ; $i < count($oldcards) ; $i++) {
if($array[$i] == $empty) {
$free=$i;
}
}
if($free== \"0\"){
if($oldcards==$empty){
$free=0;
}
else {
$free=$total;
}
}
// Place existing cards into an array.
$fd = fopen( \"$cardfile\", \"r\");
$oldcards = \"\"; // Leave this blank
while ($buffer = fgets($fd, 4096)) {
$oldcards .= $buffer;
}
fclose($fd);
// Change Text so that it doesn\'t interfere with messages
$message = str_replace( \":\",chr(0),$message); // Colon to null character
$message = str_replace( \" \", \" \",$message); // Double Space to HTML Space ( )
$remail = str_replace( \":\",chr(0),$remail);
$recipient = str_replace( \":\",chr(0),$recipient);
$semail = str_replace( \":\",chr(0),$semail);
$sender = str_replace( \":\",chr(0),$sender);
// Generate a Random Number - Security
srand((double)microtime()*1000000); // Random Seed
$random = rand(1000,9000); // Range (between 1000-9000)
// What is written to the Text File
$newcard = $free+1 . \":\" . $picture . \":\" . nl2br(htmlentities($remail)) . \":\" . nl2br(htmlentities($recipient)) . \":\" . nl2br(htmlentities($semail)) . \":\" . nl2br(htmlentities($sender)) . \":\" . eregi_replace( \"\\n\", \"<br>\", $message ) . \":\" . $random . \"\\n\";
$allcards = $oldcards . $newcard;
$idnumber=$free+1;
// If the recipient\'s email is correct
if (eregi( \"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*$\", $remail)) {
// Preview Message
echo \"<table BORDER=0 WIDTH=\\\"100%\\\">\\n<tr>\\n<td ALIGN=CENTER VALIGN=TOP>\\n<IMG src=\\\"$picture\\\">\\n</td>\\n \";
echo \"<td VALIGN=TOP>\\n<table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH=\\\"100%\\\">\\n<tr>\\n<td>\\n<b>To:</b>\\n</td>\\n<td>\\n<a href=\\\"mailto:$remail\\\">\";
echo stripslashes(htmlentities($recipient)) . \"</a>\\n</td>\\n</tr>\\n\";
echo \"<tr>\\n<td>\\n<b>From:</b></td>\\n<td>\\n<a href=\\\"mailto:$semail\\\">\";
echo stripslashes(htmlentities($sender)) . \"</a>\\n</td>\\n</tr>\\n</table>\\n\";
echo \"<B>Message:</B><BR>\" . stripslashes(nl2br(htmlentities($message))) . \"</td>\\n</td>\\n</tr>\\n</table>\\n\";
// If the sender\'s email is correct
if (eregi( \"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*$\", $semail)) {
if ($epost == \"yes\") { // Write to file
$cartFile = fopen( \"$cardfile\", \"w\");
fwrite($cartFile,$allcards);
fclose($cartFile);
// Message to be included in email
$email_message = \"For at hente dit kort, så besøg:
HTTP://pg.whitehat.dk/cards/receive.php3?viewcard=$idnumber&random=$random\"
The Message Text Follows:
\" . eregi_replace( \"<br>\", \"\\n\",stripslashes($message));
// Send to recipient - Taken Out: Reply-To: $semail \\r\\n X-Mailer: PHP3 \\r\\n
mail(stripslashes($recipient) . \"<$remail>\", stripslashes($sender) . \" has sent you a card\", $email_message, \"From: $semail \\nReply-To:$semail\\nX-Mailer: PHP3\\r\\n Errors-To: mike@flora.org\");
// To send another card
echo \"<P><hr width=\\\"50%\\\"><P>Your card number $idnumber has been sent to \" . stripslashes($recipient);
echo \"<p>\\n<strong>Would you like to send another card?</strong><p>\\n\";
echo \"<form method=\\\"GET\\\" action=\\\"send.phtml\\\">\";
echo \"<input type=\\\"radio\\\" value=\\\"yes\\\" NAME=\\\"epost\\\">Yes, please!\";
echo \"<input type=\\\"radio\\\" value=\\\"no\\\" NAME=\\\"epost\\\">No, thank you.\";
echo \"<input type=hidden name=\\\"remail\\\" value=\\\"$remail\\\">\";
echo \"<input type=hidden name=\\\"recipient\\\" value=\\\"\" . stripslashes(htmlentities($recipient)) . \"\\\">\";
echo \"<input type=hidden name=\\\"semail\\\" value=\\\"$semail\\\">\";
echo \"<input type=hidden name=\\\"sender\\\" value=\\\"\" . stripslashes(htmlentities($sender)) . \"\\\">\";
echo \"<input type=\\\"submit\\\" value=\\\"Submit\\\"></form><br>\";
}
elseif ($epost == \"no\") {
echo \"<P><hr width=\\\"50%\\\"><P><strong>Would you like to try again?</strong><p>\\n\";
echo \"<form method=\\\"GET\\\" action=\\\"send.phtml\\\">\";
echo \"<input type=\\\"radio\\\" value=\\\"yes\\\" NAME=\\\"epost\\\">Yes, please!\";
echo \"<input type=\\\"radio\\\" value=\\\"no\\\" NAME=\\\"epost\\\">No, thank you.\";
echo \"<input type=hidden name=\\\"picture\\\" value=\\\"$picture\\\">\";
echo \"<input type=hidden name=\\\"remail\\\" value=\\\"$remail\\\">\";
echo \"<input type=hidden name=\\\"recipient\\\" value=\\\"\" . stripslashes(htmlentities($recipient)) . \"\\\">\";
echo \"<input type=hidden name=\\\"semail\\\" value=\\\"$semail\\\">\";
echo \"<input type=hidden name=\\\"sender\\\" value=\\\"\" . stripslashes(htmlentities($sender)) . \"\\\">\";
echo \"<input type=hidden name=\\\"message\\\" value=\\\"\" . stripslashes(htmlentities($message)) . \"\\\">\";
echo \"<input type=\\\"submit\\\" value=\\\"Submit\\\"></form><br>\";
}
else {
echo \"<P><hr width=\\\"50%\\\"><P><strong>You have not YET sent the card.</strong><p>\\n\";
echo \"<form method=\\\"GET\\\" action=\\\"send.php3\\\">\";
echo \"<input type=\\\"radio\\\" value=\\\"yes\\\" NAME=\\\"epost\\\">Yes, please send my card!\";
echo \"<input type=\\\"radio\\\" value=\\\"no\\\" NAME=\\\"epost\\\">No thank you.\";
echo \"<input type=hidden name=\\\"picture\\\" value=\\\"$picture\\\">\";
echo \"<input type=hidden name=\\\"remail\\\" value=\\\"$remail\\\">\";
echo \"<input type=hidden name=\\\"recipient\\\" value=\\\"\" . stripslashes(htmlentities($recipient)) . \"\\\">\";
echo \"<input type=hidden name=\\\"semail\\\" value=\\\"$semail\\\">\";
echo \"<input type=hidden name=\\\"sender\\\" value=\\\"\" . stripslashes(htmlentities($sender)) . \"\\\">\";
echo \"<input type=hidden name=\\\"message\\\" value=\\\"\" . stripslashes(htmlentities($message)) . \"\\\">\";
echo \"<input type=hidden name=\\\"idnumber\\\" value=\\\"$idnumber\\\">\";
echo \"<input type=hidden name=\\\"\\\" value=\\\"$\\\">\";
echo \"<input type=\\\"submit\\\" value=\\\"Submit\\\"></form><br>\";
}
} // End of verification for $semail
else { echo \"<strong>This card was NOT sent because a valid email address was not provided!</strong><p>\\n\"; }
} // End of verification for $remail
else { echo \"<strong>A preview was NOT provided because a valid email address was not provided!</strong><p>\\n\"; }
?>
</body>
</html>
Fejlen er: Parse error: parse error in send.php3 on line 85