zero-perfoliate
zero-perfoliate

Author Topic: Problem with contact formular in PHP  (Read 281 times)

Offline olexik@gmail.com

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
Problem with contact formular in PHP
« on: December 10, 2010, 01:40:43 AM »
Hi, I downloaded a FLASH web template with PHP and I have problem with send e-mail from contact formular to my e-mail.

in flash is action to button SEND:

on (release) {
   url_var = "server_option="+_root.server_option+"&recipient="+_root.recipient+"&your_name="+_parent.t1_2+"&your_email="+_parent.t4_2+"&comments="+_parent.t5_2+"&phone="+_parent.t3_2+"&company="+_parent.t2_2;
   getURL("contact."+_root.server_option+"?"+url_var, "_blank", "GET");
   _parent.t1_2 = "your name:";
   _parent.t2_2 = "your company:";
   _parent.t3_2 = "telephone:";
   _parent.t4_2 = "e-mail:";
   _parent.t5_2 = "message:";
}

then I have file contact.php:

<?
$subject="from".$_GET['your_name'];
$headers= "From:".$_GET['your_email']."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
mail($_GET['my@email.com'], $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>



  ".$_GET['message']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
   resizeTo(300, 300)
   //window.close()
</script>

and contact.asp:

<%
   Set reg = New RegExp
   reg.Pattern = "^[A-Za-z0-9\._\-]+@([A-Za-z0-9\._\-]+\.)+[A-Za-z0-9\._\-]+$"
   Set m = reg.Execute(Request.QueryString("your_email"))
   
   if m.count > 0 then
      smtpServer = "swapper.loc"
      smtpPort = 25

      name = Request.QueryString("your_name")
      Set myMail = CreateObject("CDO.Message")
      myMail.Subject = "from " & name
      myMail.From = Request.QueryString("your_email")
      myMail.To = Request.QueryString("my@email.com")
      myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body>
" & Request.QueryString("message") & "</body></html>"
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
      myMail.Configuration.Fields.Update
      myMail.Send
      Response.Write("Your email was sent")
   else
      Response.Write("Invalid email")
   End if
   
%>
<script>
   resizeTo(300, 300)
   //window.close()
</script>

flash have main.php, where is
&server_option=php
&recipient=my@email.com

I don't know, where is mistake. Can you help me, please.

martin

 

zero-perfoliate