×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Kaxa Mgebrishvili
Added: Nov 21, 2014 8:55 AM
Views: 22
Tags: rame
file
  1. <?php
  2. include_once("config.php");
  3.  
  4.  
  5.  
  6. $ERurl="";
  7.  
  8. if($_POST['mail'])
  9. {
  10. $fullname=$_POST['fullname'];
  11. $email=$_POST['email'];
  12. $text=$_POST['text'];
  13.  
  14. $fullname=trim(stripslashes($fullname));
  15. $email=trim(stripslashes($email));
  16. $text=trim(stripslashes($text));
  17.  
  18.  
  19. $err=0;
  20.  
  21.  
  22. if(empty($fullname))
  23. {
  24. $err=$err+1;
  25. $ERurl=$ERurl."სახელის ველი ცარიელია!<br>";
  26. }
  27. if(empty($email))
  28. {
  29. $err=$err+1;
  30. $ERurl=$ERurl."ელ. ფოსტის ველი ცარიელია!<br>";
  31. }
  32. if(!empty($email))
  33. {
  34. if(!preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i",$email))
  35. {
  36. $err=$err+1;
  37. $ERurl=$ERurl."ელ. ფოსტის მისამართი არასწორია!<br>";
  38. }
  39. }
  40. if(empty($text))
  41. {
  42. $err=$err+1;
  43. $ERurl=$ERurl."ტექსტის ველი ცარიელია!<br>";
  44. }
  45.  
  46.  
  47.  
  48. if($err==0)
  49. {
  50.  
  51.         $recipient = "info@eurocatering.ge";
  52.         $mail_body = "From ".$fullname; //mail body
  53.         $subject = $text;
  54.         $header1 = "From: ". $fullname . " <" . $email . ">\r\n"; //optional headerfields
  55.        
  56.         mail($recipient, $subject, $mail_body, $header1);
  57.         $show=1;
  58. }
  59.  
  60. }
  61.  
  62.  
  63. ?>
  64.  
  65. <html>
  66. <head>
  67. <title>Euro Catering</title>
  68. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  69. <link rel=stylesheet type="text/css" href="stylesheet.css"/>
  70. </head>
  71. <body bgcolor="#45391f">
  72. <table align="center" cellpadding="0" cellspacing="0">
  73. <tr><td align="left"><img src='geo.gif' border='0'> | <a href='eng/'><img src='eng.gif' border='0'></a></td></tr>
  74. <tr><td align="right">
  75.  
  76.  
  77. <?
  78. if($_SESSION['eurocatering']['id']>0)
  79. {
  80.         echo '<table><tr><td style="color: #ffffff;">მოგესალმებით, <a href="editinfo.php">'.base64_decode($_SESSION['eurocatering']['fullname']).'</a></td><td style="color: #ffffff;"> <a href="index.php?kill">გასვლა</a></td></tr></table><br>';
  81. }
  82. else
  83. {
  84.         echo '<form action="index.php" method="post"><table><tr><td>'.$autherr.'</td><td><input type="text" name="aemail" style="width: 100px; height: 18px; font-size: 11px;"></td><td><input type="password" name="apassword" style="width: 100px; height: 18px; font-size: 11px;"></td><td><input type="image" src="but.gif" style="width: 50px;"></td></tr></table></form>';
  85. }
  86. ?>
  87.  
  88.  
  89. </td></tr>
  90.  
  91.  
  92. <tr><td align="center">
  93. <img src="headline.jpg" border="0">
  94. </td></tr>
  95.  
  96. <tr>
  97. <td align="center" background="back2.jpg">
  98. <table cellpadding="0" cellspacing="0" width="100%" border="0">
  99. <tr><td valign="top" align="right" width="216">
  100. <? include_once("hmenu.php"); ?>
  101. </td>
  102. <td align="center">
  103.  
  104.  
  105. <?
  106. if($show==0)
  107. {
  108. ?>
  109.  
  110. <form action="contact.php" method="post">
  111. <table>
  112. <tr>
  113.         <td colspan="2" align="center" valign="middle" height="50">საკონტაქტო ინფორმაცია</td>
  114. </tr>
  115. <tr>
  116.         <td colspan="2" valign="middle">მობ: (+995) 99 46 46 46</td>
  117. </tr>
  118. <tr>
  119.         <td colspan="2" valign="middle">ელ. ფოსტა: info@eurocatering.ge</td>
  120. </tr>
  121. <tr>
  122.         <td colspan="2" align="center" style="color: #cd1414;"><?=$ERurl; ?></td>
  123. </tr>
  124. <tr>
  125.         <td colspan="2" align="center"><hr size="1" color="#000000"></td>
  126. </tr>
  127. <tr>
  128.         <td>სახელი</td><td align="right"><input type="text" name="fullname" value="<?=$fullname; ?>"></td>
  129. </tr>
  130. <tr>
  131.         <td>ელ. ფოსტა</td><td align="right"><input type="text" name="email" value="<?=$email; ?>"></td>
  132. </tr>
  133. <tr>
  134.         <td align="right" colspan="2"><textarea name="text" cols="45" rows="5"><?=$text; ?></textarea></td>
  135. </tr>
  136. <tr>
  137.         <td colspan="2" align="center"><hr size="1" color="#000000"></td>
  138. </tr>
  139. <tr>
  140.         <td colspan="2" align="center"><br><input type="submit" name="mail" value=" გაგზავნა "></td>
  141. </tr>
  142. </table>
  143. </form>
  144.  
  145. <?
  146. }
  147. if($show==1)
  148. {
  149.         echo '<table><tr><td align="center" valign="middle" height="100">თქვენი შეტყობინება გაიგზავნა</td></tr></table>';
  150. }
  151. ?>
  152.  
  153.  
  154. </td></tr>
  155. </table>
  156.  
  157. </td></tr>
  158.  
  159. <tr><td background="back2.jpg"><br><br></td></tr>
  160.  
  161. <tr><td align="right">
  162. <font color="grey" face="Arial" size="1">Copyright Euro Cattering. All Rights Reserved.</font>
  163. </td></tr>
  164. </table>
  165. </body>
  166. </html>
  167.