contact.asp contact.php

  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

I am very new to action script, and need to make a couple of things work for a friend who bought a flash template. the website is bonniesherman.com. I read everything I could about how to make these functions work, but I am still confused. What do I need to modify in these scripts to make the contact form work?

action code on the submit button that came with the template:
on (release) {
var your_name_descr = _parent.your_name_descr;
var your_email_descr = _parent.your_email_descr;
var field_1_descr = _parent.field_1_descr;
var field_2_descr = _parent.field_2_descr;
var field_3_descr = _parent.field_3_descr;
var field_4_descr = _parent.field_4_descr;
var field_5_descr = _parent.field_5_descr;
var field_6_descr = _parent.field_6_descr;
var field_7_descr = _parent.field_7_descr;
var message_descr = _parent.message_descr;
var message = _parent.message;
var field_1 = _parent.field_1;
var field_2 = _parent.field_2;
var field_3 = _parent.field_3;
var field_4 = _parent.field_4;
var field_5 = _parent.field_5;
var field_6 = _parent.field_6;
var field_7 = _parent.field_7;
var your_email = _parent.your_email;
var your_name = _parent.your_name;
getURL("contact."+serv.text, "_blank", "POST");
i = 1;
while (this["field_"+i]) {
_parent["field_"+i] = "";
i++;
}

contact.php code looks like this:
<?
Print_r ($_REQUEST);

Error_Reporting(E_ALL & ~E_NOTICE);
$subject="from".$_REQUEST['your_name'];
$headers= "From:".$_REQUEST['your_email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$i=1;
$message='';
while ($_REQUEST['field_'.$i.'_descr']) {
$message.="<strong>".$_REQUEST['field_'.$i.'_descr']."</strong>&nbsp;&nbsp;&nbsp;".$_REQUEST['field_'.$i]."<br>";
$i++;
}
$message.="<br>".$_REQUEST['message']."<br><br>";
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");




?>
<script>
resizeTo(300, 300);
// window.close()
</script>

contact.asp code looks like this:
<%
for i=1 to 7
message=message + "<strong>"&Request("field_"&i&"_descr")&"</strong>&nbsp;&nbsp;&nbsp;"&Request("field_"&i)&"<br>"
next
message=message + Request("message")
smtpServer = "enter your SMTP SERVER HERE"
smtpPort = 25


name = Request("your_name")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request("your_email")
myMail.To = Request("recipient")
myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & 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

%>

Someone please help. Thank you.
  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

wow, ten views and no reply. I feel so alone! Here is an update on my problem. I went into the action script on the form and added the email address I wanted the message being sent from the form to go to. In the code it read:
______________________________________________
rec.text = "fellis@devoffice.com";
serv.text = "php";
field_1.text = "field_1 description";
field_2.text = "field_2 description";
field_3.text = "field_3 description";
field_4.text = "field_4 description";
field_5.text = "field_5 description";
field_6.text = "field_6 description";
field_7.text = "field_7 description";
function reset_txt(name, name2, value) {
path = eval(_target);
path[name2] = value;
this[name].onSetFocus = function() {
path = eval(_target);
if (path[name2] == value) {
path[name2] = "";
}
};
this[name].onKillFocus = function() {
path = eval(_target);
if (path[name2] == "") {
path[name2] = value;
}
};
}
reset_txt("t1", "your_name", "YOUR NAME:");
reset_txt("t2", "your_email", "YOUR E-MAIL:");
reset_txt("t4", "message", "MESSAGE:");
________________________________________________
I just replaced the
rec.text = "fellis@devoffice.com";
with
rec.text = "myemailaddress@yahoo.com";
I feel like that is a good but small start because I am not getting the email when I test it. I get a pop-up 405 error with the address at the websitedomain/contact.php
Can someone help me from here? I don't even know what .asp or .php is. But, I will look around for some tutorials and check back. Thank you in advance.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

hmmm, not sure what exactly you are trying to do there,
but you can always search in this forum for: "send email loadvars"
  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

Thank you for the search info. It was a big help in recognizing where the problem might be. One thing is for sure, I will try to learn php after this fiasco. What I am trying to do is send a form to an email address. I tried to rewrite it a different way. Here is what the action script looks like now:
___________________________________________________
rec.text = "uniqueminer@yahoo.com";
serv="php";

var fields_descriptions= Array ("",
Array("t1", "your_name", "YOUR NAME:"),
Array("t2", "your_email", "YOUR E-MAIL:"),
Array("t3", "telephone", "Telephone:"),
Array("t4", "message", "MESSAGE:"),
Array("t5", "field_2", "E-mail:"),
Array("t6", "field_3", "Address:"),
Array("t7", "field_4", "fax:")
);

function reset_txt(name,name2,value) {
path=eval(_target);
path[name2]=value;

this[name].onSetFocus=function() {
path=eval(_target);
if(path[name2]==value) { path[name2]="";}
}

this[name].onKillFocus=function() {
path=eval(_target);
if(path[name2]=="") { path[name2]=value;}
}
}


for (i=1; i<=fields_descriptions.length; i++) {
reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
}
____________________________________________________
when I test the send button, it pops up (_target) a window with a 405 error, and the email isn't recieved.
  • iwd4u
  • Newbie
  • Newbie
  • iwd4u
  • Posts: 8
  • Loc: Minnesota, USA

Post 3+ Months Ago

What about editing this portion:

myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/c onfiguration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/c onfiguration/smtpserver") = smtpServer
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/c onfiguration/smtpserverport") = smtpPort
myMail.Configuration.Fields.Update
myMail.Send
  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

Okay, now I know I am getting close. On release it is still popping up in a new window a 405 error, but it gets the URL correct, /contact.php
_________________________________________________
This is the script on my form
_________________________________________________
rec.text = "uniqueminer@yahoo.com";
serv="php";

var fields_descriptions= Array ("",
Array("t1", "your_name", "YOUR NAME:"),
Array("t2", "your_email", "YOUR E-MAIL:"),
Array("t4", "message", "MESSAGE:"),
);

function reset_txt(name,name2,value) {
path=eval(_target);
path[name2]=value;

this[name].onSetFocus=function() {
path=eval(_target);
if(path[name2]==value) { path[name2]="";}
}

this[name].onKillFocus=function() {
path=eval(_target);
if(path[name2]=="") { path[name2]=value;}
}
}


for (i=1; i<=fields_descriptions.length; i++) {
reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
}
_____________________________________________________
This is my button
_____________________________________________________
on (release) {
for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[i][1]] != _parent.fields_descriptions[i][2]) {
this[_parent.fields_descriptions[i][1]] = _parent[_parent.fields_descriptions[i][1]]+"&777&"+_parent.fields_descriptions[i][2];
}
_parent.reset_txt(_parent["t"+i], _parent.fields_descriptions[i][1], _parent.fields_descriptions[i][2]);
}
this.recipient = _parent.rec;
i = undefined;
getURL("contact."+_parent.serv, "_blank", "POST");
}
______________________________________________________
and this is my contact.php
_______________________________________________________
<?
Error_Reporting(E_ALL & ~E_NOTICE);

while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}



reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}

mail("uniqueminer@yahoo.com", $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
resizeTo(300, 300);
</script>
  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

Here is an update. The template people gave me an asp file and a php file. I said I didn't know anything about them right? Well, for other newbies like me here is something that might help you. asp and php do the same thing for the form mailer. they are different languages for the same task. contact your host and find out what kind of protocol your server supports (php or asp) and go from there. My tech support people are out to lunch, hence I am here learning whatever I can. php looks hard but I am trying to catch on. Thanks to you two guys for trying to help. I now know I only have to modify this thing in two places to get it to work. I need to modify the php file and the action script! Should I have posted this somewhere else, is everyione else as confused, or what am I missing? Why so little help?
  • uniqueminer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: Pasadena, California

Post 3+ Months Ago

Problem Solved!
Thank you to those who posted in other areas on this site.
And there you have it. With a little hard work and some good direction from you good people, I have a working email form for my newly designed flash website. I was so miserably lost! But, here is the solution.
open notepad
paste the following command
ForceNoProxy On
(What does it mean? I don't really know.)
But if you save it as:
".htaccess"
and upload it to your site and try your form again, you will see a BEAUTIFUL little pop up that says:
Your message was successfully sent!
and you will let go a laugh, jump high, click your heals, and dance a lick...
like Mr. Bo Jangles
  • fhehle
  • Born
  • Born
  • fhehle
  • Posts: 2
  • Loc: Canada

Post 3+ Months Ago

uniqueminer wrote:
Problem Solved!
Thank you to those who posted in other areas on this site.
And there you have it. With a little hard work and some good direction from you good people, I have a working email form for my newly designed flash website. I was so miserably lost! But, here is the solution.
open notepad
paste the following command
ForceNoProxy On
(What does it mean? I don't really know.)
But if you save it as:
".htaccess"
and upload it to your site and try your form again, you will see a BEAUTIFUL little pop up that says:
Your message was successfully sent!
and you will let go a laugh, jump high, click your heals, and dance a lick...
like Mr. Bo Jangles


Hi Uniqueminer, hopefully you get a chance to read this. First I have to say that I am not good at all in programming...I bought a website template (my site is http://www.o-zone-productions.com) and have that same problem you had, although I can't find a way to make this work even with your great explanations.

Do you think you can help me? (or anybody)
I've been trying everything for the last 2 weeks now and I am desperate to find a way to make this contact box to work...

Here's the code I received with the template, ANY help would be so much appreciated please. Again my site is

http://www.o-zone-productions.com

<%
for i=1 to 7
message=Request("message")
next
message=message + Request("message")
smtpServer = "enter your SMTP SERVER HERE"
smtpPort = 25


name = Request("Your_Name:")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request("Your_Email:")
myMail.To = Request("recipient")
myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & 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

%>


thank you so much
  • fhehle
  • Born
  • Born
  • fhehle
  • Posts: 2
  • Loc: Canada

Post 3+ Months Ago

fhehle wrote:
uniqueminer wrote:
Problem Solved!
Thank you to those who posted in other areas on this site.
And there you have it. With a little hard work and some good direction from you good people, I have a working email form for my newly designed flash website. I was so miserably lost! But, here is the solution.
open notepad
paste the following command
ForceNoProxy On
(What does it mean? I don't really know.)
But if you save it as:
".htaccess"
and upload it to your site and try your form again, you will see a BEAUTIFUL little pop up that says:
Your message was successfully sent!
and you will let go a laugh, jump high, click your heals, and dance a lick...
like Mr. Bo Jangles


Hi Uniqueminer, hopefully you get a chance to read this. First I have to say that I am not good at all in programming...I bought a website template (my site is http://www.o-zone-productions.com) and have that same problem you had, although I can't find a way to make this work even with your great explanations.

Do you think you can help me? (or anybody)
I've been trying everything for the last 2 weeks now and I am desperate to find a way to make this contact box to work...

Here's the code I received with the template, ANY help would be so much appreciated please. Again my site is

http://www.o-zone-productions.com

<%
for i=1 to 7
message=Request("message")
next
message=message + Request("message")
smtpServer = "enter your SMTP SERVER HERE"
smtpPort = 25


name = Request("Your_Name:")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request("Your_Email:")
myMail.To = Request("recipient")
myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & 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

%>


thank you so much


I forgot to mention...

Maybe I'm not even putting the files at the right place on my server!

do any of you guys know what all these folders are for? (sorry for being such an ignorant of the subject)

.filter
.gnupg
.panel
.vmailmgr
.public_ftp
.public_html

I was told to put everything in the .public_html folder...could that be the problem?

Or maybe I need to paste the code in the Index.html document?

Again any help would be so much appreciated please

thanks again
  • stev_ro
  • Beginner
  • Beginner
  • User avatar
  • Posts: 61
  • Loc: ro

Post 3+ Months Ago

I guess that the .public_html is your root folder....but at this question only the server administrator can answer......so contact the person(company) that hosts your site.
  • robotmachine
  • Born
  • Born
  • robotmachine
  • Posts: 1
  • Loc: Philippines

Post 3+ Months Ago

try this code..
its more simpler that your codes
but it just do the same thing...

paste this code to your send.asp page

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject=REQUEST("mysubject")
myMail.From="REQUEST("myemail")
myMail.To=REQUEST("someonesmail")
myMail.TextBody=REQUEST("mymessage")
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="smtp.server.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>
  • krismeister
  • Graduate
  • Graduate
  • krismeister
  • Posts: 202

Post 3+ Months Ago

Why did you first talk about ASP & about PHP? Do you know what kind of server you're running?

Also this is a very nice email class for php:
http://phpmailer.sourceforge.net/
with a killer unit-test.

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 10 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.