Is there a way to auto email

Hi all,

I was wondering if there is a way to fire an email to myself from an “error” page automatically, to warn me the form is not working.

Any help greatly appreciated


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What are you using to process the form? If it’s PHP, then it’s pretty straightforward:

<?php
mail($to_address,$subject,$body,'From: ' . $from_address,'-f' . $from_address);
?>

Make sure that $to_address and $from_address are properly formatted e-mail addresses (not shown here because they will be clipped by the Mailist software). The subject should be one line of text, fairly short, and the body may contain newline characters and punctuation, as long as the punctuation is properly escaped where necessary. Finally, your hosting provider may restrict the use of the fifth variable (the sendmail “apparently from” switch) so if you get a PHP error when trying to run this, just drop that final variable.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The problem here may be that an email gets generated, not necessarily when the form is not working but, when a user doesn’t complete it correctly.

Do you really want to know every time someone doesn’t do it right?

Personally I have an alternate link/mailto on the error page advising users if they have a problem with the form submission to contact soandso (@) mysite.com and let me know.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What are you using to process the form? If it’s PHP, then it’s pretty straightforward:

I am not sure I understand , the form I believe is processed by PHP (using PHP Feedback Form).

Where do I insert the code in the form page or in the “Error” page (no PHP here)?

Thanks for your help

And David, in my case if you end up seeing the “Error” page, there is definately an error since my form is not validated in any way.

Thanks a lot.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You would need to crack open the PHP Feedback Form Action and add it
inside there – in the php libraries that get published up to your site.

Walter

On Jun 4, 2008, at 8:22 PM, kitesurfer3 wrote:

What are you using to process the form? If it’s PHP, then it’s
pretty straightforward:

I am not sure I understand , the form I believe is processed by PHP
(using PHP Feedback Form).

Where do I insert the code in the form page or in the “Error” page
(no PHP here)?

Thanks for your help

And David, in my case if you end up seeing the “Error” page, there
is definately an error since my form is not validated in any way.

Thanks a lot.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

My understanding is that validation is built in to the PHP Feedback Form or you would never get to an ‘Error’ page.

Tim - time for a word from our Sponsor.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks again,

I open the “.php” file with Dreamweaver and inserted it there but nothing happened, I am not sure that is what you meant by:

You would need to crack open the PHP Feedback Form Action and add it
inside there – in the php libraries that get published up to your site.

Anyway, I am not sure that is what I want, I wanted something to trigger an auto email when my page “_Error” loads.

Do I make any sense?

Thanks for your patience


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Is the _Error page one which you make in Freeway? Because you could simply put that blob of code in the Before HTML portion of the Page > HTML Markup dialog, ensure that the page filename ends in .php, and be mail-bombed in minutes!

Every time a .php page is served by Apache, it hands off the file to the PHP interpreter first, just to see if there is anything for it to do. Any instructions are run, their output rendered into any existing HTML, and then Apache sends the result back to the browser that requested it.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, made in Freeway, I added the code and now I get an error:

Parse error: syntax error, unexpected ‘;’, expecting T_VARIABLE or ‘$’ in /mnt/w0103/d18/s46/b0287804/www/fw5/_error.php on line 74

This the code:

<?php mail(email@hidden,Form Error,Error,'From: ' . email@hidden); ?>

I deleted the “;” at the end, no change.

Is it referring to the “;” in the hidden email address?

Can’t even show you the page, all you see is the error

See: olympiawindows.com/fw5/_error.php

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Could you please pastie the code to me:

Go to http://pastie.caboo.se

and then post the URL of your paste back to the list.

I don’t trust the code highlighter here yet to get quotes and backslashes correct, even though I wrote the damned thing.

What I am guessing is that you are trying to send the variables without quotes around them. In my example, I used PHP variables (starting with a dollar sign) but in your example above, you seem to be using bare strings.

If they aren’t there now (and just hidden by the highlighter) please wrap your literal strings in single-quotes as below:

mail('email@hidden','Form Error','Error','From: email@hidden');

That line should work correctly (well, if you put the real address in it will).

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I am not sure if this is the code you need

http://pastie.org/209962.txt

Anyway something really weird is happening, I can’t see the code in the actual page, it disappears??

See: olympiawindows.com/fw5/_error.php

I thought it could be due to the cache, but I cleaned it many times, reset the browser to no avail.

But if I preview in Safari (from FW) it is there? and definitely if I look in Page/HTML Markup is there.

Any ideas what’s happening?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Aha. What’s happening here is that Freeway is encoding these addresses with html entities. Your browser can sort them out, but PHP can’t.

Two ways to fix this. One is to go into the Site Preferences and turn off the option to encode e-mail addresses.

The other is to move the code into an external file that Freeway won’t touch. Make a new text file called error_helper.php and put the original code in there. Then move into Freeway, and change the code in the HTML Markup dialog to be just this:

<?php require('error_helper.php');?>

Finally, use an FTP application to upload error_helper.php into the same folder as your _Error page.

Do either one or the other of these, both will be overkill.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry for the late reply.
The action undertakes some very basic validation if the field name ‘email’ is found but contains either no data or anything that doesn’t look too much like an email address. For full validation I’d suggest using the Validate Form Suite actions (http://www.softpress.com/kb/article.php?id=545).
Regards,
Tim.

On 5 Jun 2008, at 00:35, DeltaDave wrote:

My understanding is that validation is built in to the PHP Feedback Form or you would never get to an ‘Error’ page.

Tim - time for a word from our Sponsor.

David

FreewayActions.com - Freeware and shareware actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com

Hi Tim thanks for that - so can you just clarify - under what circumstances is the error page dropdown selector selection invoked if there is no additional validation? Is there php error checking in the -go.php page?

As you can see from the thread that kitesurfer wants the error page to trigger an email notification to let him know the form is not working.

But if the error page is not invoked he will not be notified.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter,

I did exactly like you said with the text file (don’t want to expose email address)

The other is to move the code into an external file that Freeway won’t touch. Make a new text file called error_helper.php and put the original code in there. Then move into Freeway, and change the code in the HTML Markup dialog to be just this:

> 

Finally, use an FTP application to upload error_helper.php into the same folder as your _Error page.

But guess what, even that small snip of text:

<?php require('error_helper.php');?>

in Page/HTML markup disappears in the page when viewed in any browser (Safari,Firefox,IE7 in windoze), but again I can see it in preview (off FW)???

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Success!!!

Even though I can’t see the code in page I do get email.

Thanks a lot Walter, great help!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That’s the entire point of PHP (or any other scripting language used in this design pattern). The server reads the code, and does something with that code, which may include generating some HTML or not. The browser sees the output of whatever the server did, mixed in with the static HTML parts. The code that’s inside the <? ?> is the recipe, the HTML that gets served is the cooked dish.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi KS

guess what, even that small snip of text: <?php require('error_helper.php');?>

in Page/HTML markup disappears…

Yes that is supposed to happen - the php code has no visual representation on the page - it is a server instruction. Something that, if you will, tells the server to do something. In your case send an email.

Php can be used to include images and text but that is not its purpose here.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi David,

On 6 Jun 2008, 8:50 am, DeltaDave wrote:
But if the error page is not invoked he will not be notified.

I believe I need to explain my “error” concern, grab a chair.

About 2 months ago Formmail screwed-up on me because when I updated to FW Pro5, the program in its wisdom decided by default to hide my email address.

I pay a rather large amount of money for adwords to Google and didn’t realize that I wasn’t getting “Quote Requests” because of Formmail!

It took me a while to discover it and thanks to this forum now I have a better system, but just in case as insurance, if for whatever reason the form doesn’t work I want to be notified.

That is it.

Thanks for your concern, great bunch here!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

As ever Walter is too fast to keep up with.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options