PDA

View Full Version : Forms and Flash



GreatGretsky
05-08-2007, 09:27 PM
I recently added Flash video to both my form and action pages. Now the delivery of form info is spotty. Sometimes when I test the forms, the e-mail gets through to me fine, but sometimes it never shows up.

The forms were reliable before adding the flash video -- is flash my potential problem?

My form links are:

www.nowsavecash.com/contact.html (http://www.nowsavecash.com/contact.html)

and

www.nowsavecash.com/planning.html (http://www.nowsavecash.com/planning.html)

Thanks

Andy128
05-08-2007, 11:11 PM
GreatGretsky-

To give the best help- Please post your php code that you used so we can take a look.

Also- why on the Thank You page do I see another form with action set to "action.php"? Is there another
form on this page?

As it stands- an embeded swf file should not conflict with the gathering of the form elements. Although- the embed property does have its quirks.

Andy

GreatGretsky
05-09-2007, 12:24 AM
Thanks, Andy - I received your test contact. Not sure if you tried the 2nd form, that's the one I've had trouble with today.

Here's the code for the main contact form:

<?PHP
$email = $HTTP_POST_VARS[email];
if($email == "")
$email = "noemail@given.com";
$mailto = "jwolff@altusmortgage.net";
$mailsubj = "Inquiry from NowSaveCash.com";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>

and the code for the form to order an article:

<?PHP
$email = $HTTP_POST_VARS[email];
if($email == "")
$email = "noemail@given.com";
$mailto = "jwolff@altusmortgage.net";
$mailsubj = "Request for Article from NowSaveCash.com";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>

On your comment about another form on my action page, I actually never noticed that my action page had a form on it -- maybe I used a form page as a template when I created the action page - I don't remember. I assume that I can/should remove the form on my action page?

Thank you!

Jon

Andy128
05-09-2007, 12:59 AM
Yes- remove the form and replace using the shape button.

I will test the second form in a few minutes and also look over the above code.

Andy

Andy128
05-09-2007, 01:11 AM
Well- I am no expert on PHP. However, I believe that removing the form from both the action pages will be of benefit.

Additionally- the if statement you use does not contain the second have of the code which says- " If this then do this". So to use it by the book I would do this;



<?php
$email = $HTTP_POST_VARS[email]';
if($email =="")
{
$email = nomail@given.com;
}
$mailto = "jwolff@altusmortgage.net";
$mailsubj = "Inquiry from NowSaveCash.com";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>



Try that and see if it fixes the problem.

Andy

GreatGretsky
05-09-2007, 01:45 AM
Andy,

I'll update the code to correct the syntax.

I did receive your test of the 2nd form.

I removed the form from my action pages, tested them and they worked.

I reviewed the 1st form tutorial and noticed that I had put my html code into the "Inside Body Tag" instead of the "Between Head Tag" as it's done in the tutorial. Still worked though -- I assume I should move it to the "Inside Body Tag"

Thanks.

Andy128
05-09-2007, 01:57 AM
Actually it says to place it in "Begining of Body" tag and not the "Between Head" tags.

But seeing as you have it "Inside the Body" they are both in the body of the page - I do not believe it will matter if you leave is as is. But- switching it to conform to the tutorial ("Begining of Body") will not hurt either.

Post back if if gives you any more grief.

Cheers-
Andy

GreatGretsky
05-09-2007, 04:11 AM
Thanks, Andy.

Now for some reason the if($email =="") code has stopped working.

I tried it with the parenthesis you suggested and without.

I tried it in the "Between Head Tag", "Inside Body Tag", and "Beginning of Body Tag". Each time the forms that include e-mails get delivered and the forms without e-mails don't get delivered.

I'd added the if($email =="") code to fix that exact problem, and now for some reason it no longer works.

I'm including all my html from my action page here. Any suggestions?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Thank You</TITLE>
<META name="GENERATOR" content="Created by BlueVoda">
<SCRIPT type="text/javascript">
<!--
function SwapImage()
{
var doc=document, args=arguments;
doc.$imgSwaps = new Array();
for(var i=2; i<args.length; i+=2)
{
var elem=FindObject(args[i]);
if(elem)
{
doc.$imgSwaps[doc.$imgSwaps.length]=elem;
elem.$src=elem.src;
elem.src=args[i+1];
}
}
}
function FindObject(id, doc)
{
var child, elem;
if(!doc)
doc=document;
if(doc.getElementById)
elem=doc.getElementById(id);
else
if(doc.layers)
child=doc.layers;
else
if(doc.all)
elem=doc.all[id];
if(elem)
return elem;
if(doc.id==id || doc.name==id)
return doc;
if(doc.childNodes)
child=doc.childNodes;
if(child)
{
for(var i=0; i<child.length; i++)
{
elem=FindObject(id,child[i]);
if(elem)
return elem;
}
}
var frm=doc.forms;
if(frm)
{
for(var i=0; i<frm.length; i++)
{
var elems=frm[i].elements;
for(var j=0; j<elems.length; j++)
{
elem=FindObject(id,elems[i]);
if(elem) return elem;
}
}
}
return null;
}
// -->
</SCRIPT>
</HEAD>
<BODY bgcolor="#FFFFFF" text="#000000">
<?PHP
$email = $HTTP_POST_VARS[email];
if($email == "")
{
$email = "noemail@given.com";
}
$mailto = "jwolff@altusmortgage.net";
$mailsubj = "Inquiry from NowSaveCash.com";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
<DIV style="position:absolute;left:52px;top:204px;width:131px; height:89px;z-index:0" align="center">
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR>
<TD align="left" valign="top" width="131" height="27"><A href="http://www.nowsavecash.com"><IMG id="bv01038" src="bv01038.gif" alt="http://www.nowsavecash.com" align="top" border="0" width="131" height="27" onmouseover="SwapImage(1,0,'bv01038','bv01038_over.gif')" onmouseout="SwapImage(0,0,'bv01038','bv01038.gif')"></A></TD>
</TR>
<TR><TD height="4"></TD></TR><TR>
<TD align="left" valign="top" width="131" height="27"><A href="http://www.nowsavecash.com/contact.html"><IMG id="bv01040" src="bv01040.gif" alt="http://www.nowsavecash.com/contact.html" align="top" border="0" width="131" height="27" onmouseover="SwapImage(1,0,'bv01040','bv01040_over.gif')" onmouseout="SwapImage(0,0,'bv01040','bv01040.gif')"></A></TD>
</TR>
<TR><TD height="4"></TD></TR><TR>
<TD align="left" valign="top" width="131" height="27"><A href="http://www.mapquest.com/maps/map.adp?formtype=address&addtohistory=&address=7301%20E%20Helm%20Dr&city=Scottsdale&state=AZ&zipcode=85260%2d3139&country=US&geodiff=1"><IMG id="bv01041" src="bv01041.gif" alt="http://www.mapquest.com/maps/map.adp?formtype=address&addtohistory=&address=7301%20E%20Helm%20Dr&city=Scottsdale&state=AZ&zipcode=85260%2d3139&country=US&geodiff=1" align="top" border="0" width="131" height="27" onmouseover="SwapImage(1,0,'bv01041','bv01041_over.gif')" onmouseout="SwapImage(0,0,'bv01041','bv01041.gif')"></A></TD>
</TR>
</TABLE>
</DIV>
<DIV style="position:absolute;left:971px;top:0px;width:606px;h eight:1216px;z-index:1" align="left">
<IMG src="bv01116.gif" align="top" alt="" border="0" width="606" height="1216">
</DIV>
<DIV style="position:absolute;left:35px;top:37px;width:177px;h eight:139px;z-index:2" align="left">
<IMG src="bv01141.gif" align="top" alt="" border="0" width="177" height="139">
</DIV>
<DIV style="position:absolute;left:44px;top:46px;width:160px;h eight:120px;z-index:3" align="left">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="160" height="120">
<PARAM name="movie" value="Action Thank You Edited Compressed.swf">
<PARAM name="quality" value="High">
<PARAM name="scale" value="ExactFit">
<PARAM name="wmode" value="Window">
<PARAM name="play" value="true">
<PARAM name="loop" value="false">
<PARAM name="menu" value="false">
<PARAM name="sAlign" value="L">
<EMBED src="Action Thank You Edited Compressed.swf" width="160" height="120" quality="High" wmode="Window" loop="false" play="true" menu="false" scale="ExactFit" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</DIV>
<DIV style="position:absolute;left:251px;top:29px;width:605px; height:483px;z-index:4" align="left">
<IMG src="bv01142.gif" align="top" alt="" border="0" width="605" height="483">
</DIV>
<DIV style="position:absolute;left:327px;top:220px;width:441px ;height:67px;z-index:5" align="left">
<FONT style="font-size:24px" color="#000000" face="Arial"><B>Thank you!</B><BR>
</FONT><FONT style="font-size:13px" color="#000000" face="Arial"><BR>
</FONT><FONT style="font-size:19px" color="#000000" face="Arial">Your information has been forwarded to Jon Wolff.</FONT>
</DIV>
</BODY>
</HTML>

Andy128
05-09-2007, 04:42 AM
Try replacing your php code with this and see if it works;

<?PHP
$email = $HTTP_POST_VARS[email];
if($email == "")
{
$email = "noemail@given.com";
}
$mailto = "jwolff@altusmortgage.net";
$mailsubj = "Feedback form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody = "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>

Andy

Andy128
05-09-2007, 04:45 AM
Gretksy-
I made a correction to the above- sorry. After I posted I noticed a "; I had left out.

Andy

navaldesign
05-09-2007, 07:17 AM
Please note that most ISPs are istalling new, more complicated antispam filters. Among them, some will also recognize some email addresses, like noemail@given.com as non true and will block the emails. That's why i had in the script, these lines:

if($email == "")
{
$email = $mailto;
}

which would define as sender your own email address in case the user didn't type his email address.

Please restore the script as it was and it will work

GreatGretsky
05-09-2007, 09:17 PM
Thanks, guys -- Both forms are now working for both e-mail included and not included.

Navaldesign, you'd told me to use $mailto="jwolff@altusmortgage.net ($mailto=jwolff@altusmortgage.net)" before on this forum, but I didn't understand why. Now I realize spam filters are looking for those kinds of dummy addresses so it makes sense. I should have followed your advise the first time!

Thanks a lot!

Jon

Andy128
05-09-2007, 09:29 PM
Things change all the time which makes learning a never ending process.
I too appreciate the value gained from this thread.

Thanks Naval

Andy