Просмотр файла script/card.php

Размер файла: 3.77Kb
<?php
/*-----------------------------------------------------------------------------------------
mcGalleryPRO
All code is © 2003 Marc Cagninacci.
No files may be redistributed in whole or significant part.
----------------- mcgalleryPRO IS NOT FREE SOFTWARE -------------------
You should have receive a file called license.txt in this package
--------------------------------------------------------------------------------------------*/

include './header_pop.php';
include './admin/conf.inc.php';
include './lang/'.$lang;

if ($submit == 'OK')
{
		$email_ok = eregi("^[_\.0-9a-z-]+@([0-9a-z-]+\.)+[a-z]{2,4}$", $email_exp);
		if (!$email_ok )
		{
		$bad_email = '<br>'.$l_EmailNo;
		}

  if ($nom_exp == '' || $email_exp == '' || $nom_dest == '' || $email_dest == '' || $message == '' || $bad_email != '')
  {
  $l_ecard = $l_ecard_verif . $bad_email;
  }
  else
  {
  $connect = mysql_connect($host,$login,$pass);
  mysql_select_db($base, $connect);
  $nb = substr(md5(time()),20);
  $date = date("Y-m-d");
  $nom_exp = addslashes($nom_exp);
  $nom_dest = addslashes($nom_dest);
  $message = addslashes($message);
  $query = "INSERT INTO mcgallery_card VALUES ('', '$im', '$nom_exp', '$email_exp', '$nom_dest', '$email_dest', '$message','$nb', '$date', '')";
  mysql_query($query);
  $id = mysql_insert_id();

  if ($mail_function == 1)
  {
  email("ecard", $email_dest,$l_subject_ecard,"$l_message_ecard1\n$nom_exp\n$l_message_ecard2\n$site/viewcard.php?id=$id&nb=$nb");
  }
  else
  {
  mail("$email_dest",
   "$l_subject_ecard",
   "$l_message_ecard1\n$nom_exp\n$l_message_ecard2\n$site/viewcard.php?id=$id&nb=$nb",
   "From: $nom_exp <$email_exp>");
  }
  echo '<p align="center"><br><br><br><br><font size="2">'.$l_ecard_sent.'</font></p>';
  echo '<p align="center"><a href="#" onclick="javascript:window.close()" class="lien1"><b>OK</b></a></p>';
  echo '</body></html>';
  exit();
  }
}
?>

<form method="post" action="card.php" name="formcard">
<table border="0" align="center" class="td1"><tr><td>
<table border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td align="center" class="td0" colspan="2"><font size="2"><?php echo $l_ecard; ?></font></td>
</tr>
<tr>
<td align="right" class="td2"><font size="1"><?php echo $l_your_name; ?>&nbsp;</font></td>
<td class="td2"><input type="text" size="20" name="nom_exp"></td>
</tr>
<tr>
<td align="right" class="td2"><font size="1"><?php echo $l_your_email; ?>&nbsp;</font></td>
<td class="td2"><input type="text" size="20" name="email_exp"></td>
</tr>
<tr>
<td class="td2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td align="right" class="td2"><font size="1"><?php echo $l_his_name; ?>&nbsp;</font></td>
<td class="td2"><input type="text" size="20" name="nom_dest"></td>
</tr>
<tr>
<td align="right" class="td2"><font size="1"><?php echo $l_his_email; ?>&nbsp;</font></td>
<td class="td2"><input type="text" size="20" name="email_dest"></td>
</tr>
<tr>
<td align="right" class="td2"><font size="1"><?php echo $l_your_message; ?></font></td>
<td class="td2">&nbsp;</td>
</tr>
<tr>
<td align="center" class="td2" colspan="2"><fontsize="1"><b>
<?php
include 'smilies.php';
$ns = 0;
while (list($key, $val) = each($smilies))
{
echo '<a href="#" onclick="smileycard(\' '.$key.' \'); return false">'.$val.'</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
$ns++;
if ($ns % 8 == 0) echo '<br>';
}
?>
</b></font></td>
</tr>
<tr>
<td align="center" class="td2" colspan="2"><textarea cols="30" rows="6" name="message"></textarea></td>
</tr>
<tr>
<td align="center" class="td1" colspan="2"><input type="submit" name="submit" value="OK"><input type="hidden" name="im" value="<?php echo $im; ?>"></td>
</tr>
</table>
</tr>
<tr>
<td align="center" class="td0">&nbsp;
</td></tr></table>
</form>
</body>
</html>