Hi Laura,
I suspect because of your server issues that you didn’t get my email I
sent you yesterday.
Here it is again;
Hi Laura,
Firstly apologies for the problems you are having with the action and
I’m sorry I missed the thread in my email. I’ve not had too much time
to pick up on FWTalk lately and that thread has remained unread until
now. In future don’t feel bad about CCing or BCCing me on any issue
that involves one of my actions.
Generally if the action has been working OK and then stops I would
almost always put money on something changing on the server side of
things. The first thing to do is to set an error page for each of the
three error states and see where the error is cropping up from. I
suspect it will be the ‘server failure’ page as the other two (‘not in
domain’ and ‘invalid email address’) are quite specific.
Try this;
- Take the PHP code below and paste it into a plain text file, change
the email address for your own and save the file as ‘mail.php’
- FTP the file into your server space
- Using your web browser surf to the uploaded file (Whitehall | Nursing & Rehabilitation - Boca Raton, FL
for example)
- You should receive an email called “Testing, testing”
<?php
// The message
$message = "Testing 1,2,3";
// Send
mail('email@hidden', 'Testing, testing...', $message);
?>
If you don’t get the email then there is something wrong with the way
the server is sending the emails. If you do get the email then open
the attached text file up and change your email address for the one
you are using in the real form (the one you are having problems with).
Repeat the process with the browser and see if you get the resulting
email. If you don’t then there is an issue with the spam mail
filtering (I suspect), if you do get the email then I’ve got some
detective work to do to figure out what the issue is with the action!
Let me know how you get on with this.
Regards,
Tim.
Regards,
Tim.
On 9 Feb 2010, at 19:56, LauraB wrote:
In a perfect world, my problems would have vanished while I was off
to that conference. They haven’t. I have a few “urgent” messages out
to James Wilkinson (and have had for a few days), in case his Have-
Host server is doing something odd.
Meanwhile, I have a couple of new questions that may or may not have
anything to do with this mystery. I notice in looking into files,
both on the servers when I FTP to the path, and in my resource
folders, that my online application form for Whitehall Boca –
onlineapp.html – apparently generates something called
onlineapp.go.php. The two files live in the same folder. The PHP
file, upon doing a “get info,” indicates the default app to open it
as a Microsoft Excel worksheet. Of course, I can open it in a txt
file and it shows just fine. Maybe that’s just some weirdness.
Anyway, the actual “onlineapp.go.php” material is pasted below, in
case anyone knows how to read it and can see right away if there’s
something wrong with that.
(I also have a message out to Tim Plumb, but he may be away.)
This for me truly is a crisis, and I’ll reiterate I’m willing to pay
for someone who knows how to get to the bottom of this issue.
The PHP code:
<?php
$notindomain_errorpage = "errorinsending.html";
$server_errorpage = "errorinsending.html";
$invalidaddress_errorpage = "errorinsending.html";
$successpage = "successinsending.html";
$recipient="email@hidden";
$subject="Online Application";
// Set the server variables for older (PHP4,3 etc) systems
if (!isset($_SERVER)){
$_POST = &$HTTP_POST_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
}
$servername = $_SERVER['SERVER_NAME'];
if ($_SERVER['REQUEST_METHOD']=="POST") {
if (strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])>7
|| !strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
header( "Location: ".$notindomain_errorpage );
exit;
} else {
$msg="The following information was submitted from a form on
".$servername.":nn";
foreach($_POST as $key => $val) {
//filter out any form items called send or reset
//image based submit and reset buttons will be in the format
// send_x: 13
// send_y: 10
$myKeySlice = substr("$key",0,4);
if ($myKeySlice != "send" && $myKeySlice != "rese"){
if ($key == "subject" || $key == "email" || $key == "name"){
//Prevent injection attacks by stripping tags and newlines from
the data
//Do this only on data that makes it into the e-mail header as
newlines in a message body should still be valid
$key = strip_tags($key);
$val = strip_tags($val);
if (eregi("r",$key) || eregi("n",$key)){
header( "Location: ".$notindomain_errorpage );
exit;
}
if (eregi("r",$val) || eregi("n",$val)){
header( "Location: ".$notindomain_errorpage );
exit;
}
}
//replace any underscores in the input names (PHP puts
these in!) with spaces
$key = str_replace("_"," ",$key);
//if the form item is called "subject" then set this as the
subject line of the mail
if ($key == "subject"){
$subject=$val;
} else {
if (is_array($val)){
$msg.="Item: $keyn";
foreach($val as $v)
$msg.=" $vn";
} else {
$msg.="$key: $valn";
}
}
}
}
//set up the default headers
$headers = "";
//get the senders name (if specified)
if ($_POST["Name"]) {
$name = $_POST["Name"];
} else {
$name = "";
}
//get the senders email address (if specified)
if (isset($_POST["Email"])) {
$email = $_POST["Email"];
if (!preg_match('/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-.]+.[a-zA-
Z]+(.[a-zA-Z]+)?$/', $email)){
header( "Location: ".$invalidaddress_errorpage );
exit;
}
} else {
//the email is missing!
//strip the domain from the address
//www.domain.com -> domain.com
if (substr($servername,0,4) == "www."){
$theaddress = substr($theaddress,4);
}
$email = "noreply@".$theaddress;
$msg.="n
n------------------------------------------------------------------";
$msg.="nPLEASE NOTE: This is a message from the ".$servername." web
site";
$msg.="nand has been sent from a machine and not a person.";
$msg.="nPlease do not reply to this e-mail as it will bounce.";
$
msg
.=
"n
------------------------------------------------------------------";
$recipient = "email@hidden";
}
$headers .= "From: $name <$email>rn";
//add the correct headers for plain text
//see: http://www.webmasterworld.com/php/3949990.htm
$headers .= "MIME-Version: 1.0n";
$headers .= "Content-type: text/plain; charset="ISO-8859-1"n";
$headers .= "Content-transfer-encoding: 7bitn";
$headers .= "Reply-To: $emailrn"."Return-Path: $email";
error_reporting(0);
if (mail($recipient, $subject, $msg, $headers)){//
header( "Location: ".$successpage );
} else {
header( "Location: ".$server_errorpage );
}
}
} else {
header( "Location: ".$server_errorpage );
}
?>
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
FreewayActions.com - Freeware and commercial 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
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options