Lunarpages Web Hosting Forum

Author Topic: Php script and LP email disfunction  (Read 5918 times)

Offline dezign2

  • Intergalactic Superstar
  • *****
  • Posts: 184
    • http://www.dezignconcepts.com
Php script and LP email disfunction
« on: April 12, 2004, 12:37:05 PM »
I would like to know if anyone can explain why my php script works perfectly when directed to a hotmail and prodigy email address but does not work fully when directed to 2 LP accounts.

On my site www.birtht.com I had someone create a php form mail script that has a 3 part form to fill out. The form can accomodate personalized birth information for up to 3 babies. Upon testing, if I fill out information for (1) baby only, I get a return email. However, if I fill out the information for 2-3 babies, an email is not generated. There are no error messages either. I just don't get an email. :-?

Then, when I redirect the form to a hotmail address or a prodigy address, an email is generated whether I fill out info for 1-2- or 3 babies.  :yey:

Obviously, the form works, right??? Can this be a conflict with LP???

I have contacted LP Tech support and have gotten the run around.  :whip:

If anyone has any idea as to what could be causing this I would deeply appreciate the input.

Thanks,
Lona

Unless you're the lead dog, the scenery is all the same.

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #1 on: April 12, 2004, 12:44:47 PM »
We'd have to see some code to have any chance of helping.

 - Virgil

Offline w98

  • Galactic Royalty
  • *****
  • Posts: 443
    • http://iandouglas.com
Php script and LP email disfunction
« Reply #2 on: April 12, 2004, 12:59:57 PM »
Yep, I concur with Virgil. I have PHP-generated Emails coming to my LP accounts just fine, we'd need to see your code.

-id

Offline dezign2

  • Intergalactic Superstar
  • *****
  • Posts: 184
    • http://www.dezignconcepts.com
Php script and LP email disfunction
« Reply #3 on: April 13, 2004, 06:39:01 PM »
Here is the code for the php form mail.

Let me know what you think.


Code: [Select]

";

// foreach ($_POST as $key => $value)
// {
// if ($value != "")
// {
// $message .= "$key" . stripslashes(nl2br($value)) . "";
// }
// }

$message .= "Name: " . stripslashes($_POST['name']) . "";
$message .= "Email: " . stripslashes($_POST['submit_by']) . "";
$message .= " ";

$message .= "BABY #1 INFO";
$message .= "BABY NAME: " . stripslashes($_POST['babysname1']) . "";
$message .= "PARENTS NAMES: " . stripslashes($_POST['parentsnames1']) . "";
$message .= "DOB: " . stripslashes($_POST['dateofbirth1']) . "";
$message .= "TIME: " . stripslashes($_POST['timeofbirth1']) . " " . stripslashes($_POST['time1']) . "";
$message .= "WEIGHT: " . stripslashes($_POST['weightlbs1']) . " lbs ";
$message .= stripslashes($_POST['weightozs1']) . " oz";
$message .= "LENGTH: " . stripslashes($_POST['length1']) . "";
$message .= "GENDER: " . $_POST['gender1'] . "";
$message .= "SHIRT SIZE: " . $_POST['shirtsize1'] . "";

if ($_POST['babysname2'] != "")
{
$message .= " ";
$message .= "BABY #2 INFO";
$message .= "BABY NAME: " . stripslashes($_POST['babysname2']) . "";
$message .= "PARENTS NAMES: " . stripslashes($_POST['parentsnames2']) . "";
$message .= "DOB: " . stripslashes($_POST['dateofbirth2']) . "";
$message .= "TIME: " . stripslashes($_POST['timeofbirth2']) . " " . stripslashes($_POST['time2']) . "";
$message .= "WEIGHT: " . stripslashes($_POST['weightlbs2']) . " lbs ";
$message .= stripslashes($_POST['weightozs2']) . " oz";
$message .= "LENGTH: " . stripslashes($_POST['length2']) . "";
$message .= "GENDER: " . $_POST['gender2'] . "";
$message .= "SHIRT SIZE: " . $_POST['shirtsize2'] . "";
}


if ($_POST['babysname3'] != "")
{
$message .= " ";
$message .= "BABY #3 INFO";
$message .= "BABY NAME: " . stripslashes($_POST['babysname3']) . "";
$message .= "PARENTS NAMES: " . stripslashes($_POST['parentsnames3']) . "";
$message .= "DOB: " . stripslashes($_POST['dateofbirth3']) . "";
$message .= "TIME: " . stripslashes($_POST['timeofbirth3']) . " " . stripslashes($_POST['time3']) . "";
$message .= "WEIGHT: " . stripslashes($_POST['weightlbs3']) . " lbs ";
$message .= stripslashes($_POST['weightozs3']) . " oz";
$message .= "LENGTH: " . stripslashes($_POST['length3']) . "";
$message .= "GENDER: " . $_POST['gender3'] . "";
$message .= "SHIRT SIZE: " . $_POST['shirtsize3'] . "";
}

$message .= "";
 
/* To send HTML mail, you can set the Content-type header. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
 
/* additional headers */
$headers .= "From: BirthT@DezignConcepts.com\r\n";
//$headers .= "Cc: $submit_by\r\n";
//$headers .= "Bcc: check@example.com\r\n";
 
/* and now mail it */
mail($to, $subject, $message, $headers);
?>



Thank you!
Your information has been sent and I will be in touch with you soon.
Home Page

Lona

Unless you're the lead dog, the scenery is all the same.

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #4 on: April 16, 2004, 11:17:39 AM »
You didn't supply complete code (specifically, we don't get to see how the form is defined or directed) but I have some thoughts.

I did not that you have stated that both the email and the form are being directed at different hosts. Did you only mean to discuss the emails?

Also, you stated that you directed to 2 LP accounts. Was that a single email being sent to two accounts, or two different emails being sent to a single account on different occasions.

You should not be testing the 2nd and 3rd baby names against a single space string (" ") which is what you showed. Rather it should be checking with either empty() http://www.php.net/empty or is_set() http://www.php.net/is_set and probably both. Your form is probably NOT sending a single blank character when the user chooses not to key into those fields.

That aside, I'm also wondering that the $to address looks like when it is actually run.

Anyway, the few things I've pointed out are not taking us to the solution. Rather you need to supply the complete code so we can put it into a test environment and debug it. Also, provide us with the test data you are using.

 - Virgil

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #5 on: April 16, 2004, 12:27:39 PM »
The script works fine when using a non-LP email account. When using an LP email account it only delivers the email if the info for one baby has been filled out. If two or three babies have info, no email arrives to an LP email account. The fields are being tested against an empty string, not a single space. Since it works fine with her non-LP address I know the logic is fine.

Oh and this should really be in the PHP forum...
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

Offline w98

  • Galactic Royalty
  • *****
  • Posts: 443
    • http://iandouglas.com
Php script and LP email disfunction
« Reply #6 on: April 16, 2004, 12:31:42 PM »
can you post the entire script plus how you're constructing the form? It's very peculiar that it will send to external Email accounts, but not within LP.

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #7 on: April 17, 2004, 07:20:54 AM »
I take it scanman20 is the author.

Space vs. empty string... It looked like a single space on my machine. My error.

It is very peculiar and might have something to do with the content of the email addresses.

 - Virgil

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #8 on: April 17, 2004, 11:39:31 AM »
It's very odd to me as well since I've tested it on non LP servers under both Linux and Windows and haven't had a problem until it sends email to dezign2's LP account, and only then does it not act normally if more than one section of the form is filled out. Very puzzling.
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

Offline w98

  • Galactic Royalty
  • *****
  • Posts: 443
    • http://iandouglas.com
Php script and LP email disfunction
« Reply #9 on: April 17, 2004, 12:01:47 PM »
okay, please post the sscript in its entirety plus how you generate the form, and I'll be happy to test it on my account as well.

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #10 on: April 17, 2004, 07:51:10 PM »
There's really nothing aside from what has been posted already that affects the script. dezign2 if you choose to share the script please PM it to whoever you choose.
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

leighsww

  • Guest
Php script and LP email disfunction
« Reply #11 on: April 17, 2004, 08:08:29 PM »
Logically, it can't be the script because it's working with using other email addys, it just doesn't work with the LP one.

Also, it's only when using the 2 or 3 baby info that this error occurs, and works perfectly fine with only 1 baby info even with the LP hosted email addy.

Lona - are you using email filtering or Spam-Assassin?

Could there be something that gets generated in the header info of the email when using 2 or 3 baby info that may be getting filtered?

That is the only conclusion I can derive that makes any sense to this dilemma.

If you are using email filtering or Spam-Assassin, check your configs and see if this is not the case.

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #12 on: April 17, 2004, 10:19:41 PM »
We have no idea what the actual values of $to, $subject, and $message are.  Since we've only been shown partial code, even the content of $message is suspect (as the first mention we see is a concatenation).

The additional headers here seem to be properly constructed. The code even has the original comments directly from example 4 from the mail() function documentation from the php manual.

I find it odd that empty strings are continually concatenated throughout the $message construction and rarely any newline or <br> instructions. Possible that some code didn't get pasted into the example correctly? These are the kinds of things that make me suspect that we are even seeing the actual code.

I just spent three days convincing a person on another forum on another site to stop pasting partial code and to send me a complete file to help diagnose his problem. Once I saw the complete file, the answer was obvious... and not to be found in any code he had originally posted or emailed.

As an aside, I also note that when visiting the OPs site, I get the message:
Quote
A Runtime Error has occurred. Do you wish to Debug?
Line: 60
Error: Object expected.

every time I move my mouse over the menu bar on the left. I always get the message twice. It appears to be an issue with the mouseover code and I don't get any imageChange effect. Using IE 6.0.

 - Virgil

leighsww

  • Guest
Php script and LP email disfunction
« Reply #13 on: April 18, 2004, 12:10:44 AM »
Lona,

You should also post the link to your form.  They can't get to it via your website since what's there is not the actual form that is being displayed (it's your old stuff).

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #14 on: April 18, 2004, 05:45:06 AM »
Quote from: obsydi2
We have no idea what the actual values of $to, $subject, and $message are.  Since we've only been shown partial code, even the content of $message is suspect (as the first mention we see is a concatenation).

$to and $subject are hard coded and nothing remarkable. $message becomes whatever the user has entered and is also nothing special. Obviously we can agree that the script works since it functions properly outside of LP on multiple servers with multiple non-LP email addresses. I had thought the same thing that Leigh did with spam filtering but haven't been able to confirm this with Lona.
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)