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.
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.
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.
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:
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.
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
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.
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)???
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.
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.
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.