<?php
		// PHPCards v0.2, Allows people to set up simple online greeting cards. 
		// Copyright (C) 2000, Mike Gifford www.openconcept.on.ca 
		// 
		// This script is free software; you can redistribute it and/or 
		// modify it under the terms of the GNU General Public License 
		// as published by the Free Software Foundation; either version 2 
		// of the License, or (at your option) any later version. 
		// 
		// This program is distributed in the hope that it will be useful, 
		// but WITHOUT ANY WARRANTY; without even the implied warranty of 
		// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
		// GNU General Public License http://www.gnu.org/copyleft/ for more details. 
		// 
		// If you distribute this code, please maintain this header. 
		// 
		// This script allows users to select an image and write a personalized message. 
		// It then sends a notice to the user specified email address and saves that 
		// information to a text file. The receipient then can go and access both 
		// the saved message and image from the website at a specified URL. 
		// 
		// Includes: send.phtml, send.php3, receive.phtml, receive.php3 


include("$DOCUMENT_ROOT/ireru/ecardsconfig.php3");

$eci_array = explode("-", $eci);
$viewcard = $eci_array[0];
$eci = $eci_array[1];

// Load Cardfile into array and view specified file.
$dataarray=file("$cardfile");
$httpcounter=0;  
$selected_message="";  
$record = explode("<>", $dataarray[$viewcard-1]);
for ($x=0; $x<8; $x++)
{
$record[$x] = stripslashes($record[$x]);
// print '<br />$record['.$x.'] = '.$record[$x] ;
}

$selected_message .= '<img src="graphics/'.$record[1].'"><br />Sent by: <a href="mailto:'.$record4.'">'.$record[5].'</a>
<br />Message: '.$record[6];

$eci_stored = $record[7];
// print '<br />eci_stored: "'.$eci_stored.'"';
// print '<br />eci: "'.$eci.'"';




print '<h1>Celtic e-Cards</h1>';




// *****************************************************************
// check that the password matches the stored password
// *****************************************************************

if (($eci_stored) && (trim($eci_stored) == $eci))  
{
echo $selected_message;
}

// *****************************************************************

else if (!(bool)$eci) {
echo 'Please type your confimation number below:<br />';
echo '<form method="GET" action="receive.php3">
Confirmation Number: <input type="text" size="15" name="eci"><br />
<input type="submit" value="View Card!">
</form>';

}

// *****************************************************************

else {  // Incorrect Combination, Try Again?
echo 'The confirmation number does not appear to be valid for this card. <br />Please type your confimation number below:<br />';
echo '<form method="GET" action="receive.php3">
Confirmation Number: <input type="text" size="15" name="eci"><br />
<input type="submit" value="View Card!">
</form>';

} 
?> 