Guest User

Untitled

a guest
Feb 21st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1. <?
  2. include("config.php");
  3.  
  4. $variables=(strtolower($_SERVER['REQUEST_METHOD'])== 'GET') ? $_GET : $_POST;
  5. foreach ($variables as $k=> $v)
  6. $$k=$v;
  7.  
  8. $file = "enviar.php";
  9. $pg = $_GET['evento'];
  10. // INICIO DA ACAO ENVIA
  11. if($acao == "EnviaEmail"){
  12.  
  13. $data_envio = date('d/m/Y');
  14. $hora_envio = date('H:i:s');
  15.  
  16. $arquivo = "
  17. <style type='text/css'>
  18. body {
  19. margin-left: 0px;
  20. margin-top: 0px;
  21. margin-right: 0px;
  22. margin-bottom: 0px;
  23. font-family:$fonte;
  24. font-size:$tfonte;
  25. color:$cortexto;
  26. }
  27.  
  28. body,td,th {
  29. margin-left: 0px;
  30. margin-top: 0px;
  31. margin-right: 0px;
  32. margin-bottom: 0px;
  33. font-family:$fonte;
  34. font-size:$tfonte;
  35. color:$cortexto;
  36. }
  37.  
  38. a:link, a:active, a:visited {
  39. color:$cortexto;
  40. text-decoration: none;
  41. }
  42.  
  43. a:hover {
  44. color:$coronmouse;
  45. text-decoration: none;
  46. }
  47.  
  48. .titulosG {
  49. color: $coronmouse;
  50. font-size: 18;
  51. font-weight: bold;
  52. }
  53.  
  54. .upcase {
  55. text-transform:uppercase;
  56. }
  57. </style>
  58.  
  59. <html>
  60. <table width='100%' border='0' align='left' cellpadding='10' cellspacing='0'>
  61. <tr>
  62. <TD>
  63.  
  64. <table border='0' cellspacing='0' cellpadding='0'>
  65. <tr>
  66. <td><img src='".$usite."images/layout/img_logop.png'></td>
  67. </tr>
  68. </table>
  69. <table width='100%' border='0' cellpadding='0' cellspacing='0'>
  70. <tr>
  71. <td colspan='4' bgcolor='$corcelula1' height='2'></td>
  72. </tr>
  73. <tr>
  74. <td colspan='4' height='1'></td>
  75. </tr>
  76. <tr>
  77. <td colspan='4' bgcolor='$corcelula2' height='1'></td>
  78. </tr>
  79. </table>
  80. <br>
  81. Olá <b>$nomepara</b>,<br>
  82. <br>
  83. Seu amigo(a) <b><a href='mailto:$seuemail'>$seunome</a></b>, esteve em nosso site, e lhe indicou o link abaixo.<br>
  84. <a href='$url' target='_blank'><b>$url</b></a><br>
  85. <br>
  86. <b>$tsite</b><br>
  87. <a href='$usite'>$usite</a><br><br>
  88.  
  89. <table width='100%' border='0' cellspacing='0' cellpadding='0'>
  90. <tr>
  91. <td colspan='3' bgcolor='$corcelula1' height='2'></td>
  92. </tr>
  93. <tr>
  94. <td colspan='3' height='1'></td>
  95. </tr>
  96. <tr>
  97. <td colspan='3' bgcolor='$corcelula2' height='1'></td>
  98. </tr>
  99. <tr>
  100. <td>Este e-mail foi enviado em <b>$data_envio</b> &agrave;s <b>$hora_envio</b></td>
  101. </tr>
  102. </table>
  103. </td></tr>
  104. </table>
  105. </html>
  106. ";
  107.  
  108. //echo $arquivo;
  109.  
  110. // emails para quem será enviado o formulário (se for mais de um separar com virgula)
  111. $destino = "$emailpara";
  112. $assunto = "Indicação de Um Amigo Seu!";
  113.  
  114. // É necessário indicar que o formato do e-mail é html
  115. $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  116. $headers .= "From: $seunome <$seuemail>\r\n";
  117.  
  118. $email = mail($destino, $assunto, $arquivo, $headers);
  119. if($email){
  120. $mgs = "E-MAIL ENVIADO COM SUCESSO!";
  121. echo " <meta http-equiv='refresh' content='3;URL=javascript:self.close()'>";
  122. } else {
  123. $mgs = "ERRO AO ENVIAR E-MAIL!";
  124. echo " <meta http-equiv='refresh' content='2;URL=javascript:history.go(-1)'>";
  125. }
  126. echo "
  127. <table width='100%' border='0' align='left' cellpadding='10' cellspacing='0'>
  128. <tr>
  129. <TD><table border='0' cellspacing='0' cellpadding='0'>
  130. <tr>
  131. <td><img src='".$usite."images/layout/img_logop.png'></td>
  132. <td width='10'></td>
  133. <td><font class='upcase titulosG'>$tsite</font><br />
  134. <font size='2'><b>$ssite</b></font></td>
  135. </tr>
  136. </table>
  137. <table width='100%' border='0' cellpadding='0' cellspacing='0'>
  138. <tr>
  139. <td colspan='4' bgcolor='$corcelula1' height='2'></td>
  140. </tr>
  141. <tr>
  142. <td colspan='4' height='1'></td>
  143. </tr>
  144. <tr>
  145. <td colspan='4' bgcolor='$corcelula2' height='1'></td>
  146. </tr>
  147. </table>
  148. <br>
  149. <br>
  150. <table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' style='border: 1px solid $corcelula1;'>
  151. <tr><td bgcolor='$corcelula2' align='center' class='titulos'>&nbsp;$mgs</td></tr>
  152. </table>
  153.  
  154. <br>
  155.  
  156. </TD></tr>
  157. </table>
  158. ";
  159.  
  160. }
  161. // FIM DA ACAO ENVIA
  162.  
  163.  
  164.  
  165. // INICIO DA ACAO ENVIA
  166. if(empty($acao)){
  167. ?>
  168.  
  169. <Script Language="JavaScript">
  170. function validate(theForm) {
  171. if (theForm.seunome.value == ""){
  172. alert("Digite seu Nome!");
  173. theForm.seunome.focus();
  174. return (false);
  175. }
  176. if (theForm.seuemail.value == ""){
  177. alert("Digite seu E-mail!");
  178. theForm.seuemail.focus();
  179. return (false);
  180. }
  181. if (theForm.nomepara.value == ""){
  182. alert("Digite o nome do seu amigo!");
  183. theForm.nomepara.focus();
  184. return (false);
  185. }
  186. if (theForm.emailpara.value == ""){
  187. alert("Digite o email do seu amigo!");
  188. theForm.emailpara.focus();
  189. return (false);
  190. }
  191. return (true);
  192. }
  193. </script>
  194.  
  195.  
  196. <form action="<?=$file?>" method="post" onsubmit="return validate(this);">
  197. <input type="hidden" name="acao" value="EnviaEmail">
  198. <input type="hidden" name="url" value="<?=$usite."?pg=$pg&id=$id";?>" size="80">
  199. <table width="100%" border="0" cellspacing="0" cellpadding="3">
  200. <tr>
  201. <td>
  202.  
  203. <table width="450" border="0" cellpadding="10" cellspacing="2" bgcolor="<?=$corcelula1?>">
  204. <tr>
  205. <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  206. <tr>
  207. <td><img src="images/layout/img_topo_indicar.jpg" /></td>
  208. </tr>
  209. <tr>
  210. <td colspan="3" bgcolor="<?=$corcelula2?>" height="1"></td>
  211. </tr>
  212. </table>
  213. <br />
  214. <b>Seu amigo(a), receber&aacute; no e-mail dele(a) o link abaixo.</b><br />
  215. <a href="<?=$usite."?pg=$pg&id=$id&q=$q";?>" target="_blank"><?=$usite."?pg=$pg&id=$id&q=$q";?></a>
  216. <br />
  217. <br />
  218. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  219. <tr>
  220. <td width="446" align="center" valign="middle"><table width="430" border="0" cellspacing="0" cellpadding="0">
  221. <tr>
  222. <td width="182" valign="bottom">Seu Nome:<br />
  223. <input name="seunome" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" />
  224. <br />
  225. Seu E-mail:<br />
  226. <input name="seuemail" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" /></td>
  227. <td width="180" valign="bottom">Nome do Amigo:<br />
  228. <input name="nomepara" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" />
  229. <br />
  230. E-mail do Amigo:<br />
  231. <input name="emailpara" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="width:150;" maxlength="100" /></td>
  232. <td width="68" valign="bottom"><input style="width:80px; height:47px;" type="submit" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" name='btgravar' value="ENVIAR"></td>
  233. </tr>
  234. </table> </td>
  235. </tr>
  236. </table></td>
  237. </tr>
  238. </table>
  239.  
  240. </td>
  241. </tr>
  242. </table>
  243.  
  244. </form>
  245.  
  246. <?
  247. }
  248. // FIM DA ACAO ENVIA
  249. ?>
Add Comment
Please, Sign In to add comment