Lunarpages Web Hosting Forum

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

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #15 on: April 18, 2004, 08:24:13 AM »
Actually, we could only agree that the script works under certain circumstances and conditions. Other than that, I can't agree. Since getting the necessary information for proparly diagnosing the problem is like pulling teeth here, I'm out of this one.

 - Virgil

Offline w98

  • Galactic Royalty
  • *****
  • Posts: 443
    • http://iandouglas.com
Php script and LP email disfunction
« Reply #16 on: April 18, 2004, 11:13:20 PM »
So I'll ask for the last time: please send me the script (my Email address is posted on my web site) and I'll be happy to test it on my domain to see if it's acting up there - I have two accounts so I can test it on two separate servers at LP (Jupiter and Leo) to rule out whether it's an issue with your server.

Offline dezign2

  • Intergalactic Superstar
  • *****
  • Posts: 184
    • http://www.dezignconcepts.com
Php script and LP email disfunction
« Reply #17 on: April 19, 2004, 06:58:24 PM »
Hi,

Quote
are you using email filtering or Spam-Assassin?


No, I am not using filters or Spam Assassin with my email.

Quote
okay, please post the sscript in its entirety plus how you generate the form

Maybe I am missing something, but I thought I did post the entire script. I opened the file and copied all that I had. Is that not the correct way to copy it??

In the meantime, here is where you can find the form www.birtht.com/orders.htm

I don't know what else to give you guys. I am sorry I haven't responded until now, I have been away.

Let me know and I will provide whatever I can to get this resolved. As far as the script goes....leigh, is this the same copy I sent you??? If so, that is all I have.

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 #18 on: April 19, 2004, 10:58:41 PM »
Since the original poster has just returned... I just had to investigate using the new clues.

I filled out the order form twice. Once for three babies named Ralph and once for a single baby named Ralph. What did you get?

I guess the emails are sent to the hidden submit_to field? Where is $to populated?

And no, that couldn't be all of the script. It doesn't even start with the proper characters to be a script.

Are we to assume that the script from which the posted code was excerpted is the script idenfied as the target of your form?

 - Virgil

leighsww

  • Guest
Php script and LP email disfunction
« Reply #19 on: April 19, 2004, 11:16:24 PM »
Quote from: Lona
.leigh, is this the same copy I sent you??


Lona, you gave me the same thing that you posted above, which is not the complete script.  You can't grab the source code from your web browser for PHP.  It hides things.

Virgil -

The hidden tags in her form are actually for the old cgi script she was using in the past (bnbform.cgi).  She needs to remove those.

If you look at the action in her source code, it says:

Code: [Select]
<form name="form1" method="post" action="orders.php">

So, the "orders.php" file should have the info where the results are emailed to, etc.

Anyway, she needs to email you & w98 a copy of the orders.php file (since she's not copying the entire source code correctly) so you guys can test it out on your servers, and see if your email addys get the same problems with the 2 & 3 baby info.

If you have a non-LP hosted email addy, try that too, because that's been working for her.  It's just the LP hosted email that doesn't work.

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #20 on: April 19, 2004, 11:37:04 PM »
Well yeah, I could see the name of the script used as the target. My question is whether we are to assume that the script named there is the same as the one being posted. That's never been stated and has to be assumed. You know that *that* means...

Is there anything unique about her LP email addresses? Are they configured as (dare I say it?) forwarded email addresses  :wink: ?

 - Virgil

leighsww

  • Guest
Php script and LP email disfunction
« Reply #21 on: April 19, 2004, 11:44:46 PM »
She's posting what I think is the order.php script, but whatever she's opening it up from isn't copying it complete evidentally.

You'll have to wait for her to read this thread again, so she can email you the actual full-bodied file.

I don't know if she's using forwardings, but I'm pretty sure that the "birthT" is an add-on domain (if I can remember correctly when helping her in the past) but I wouldn't think that would matter as far as the recipient email addy is concerned.

Anyway, the first step is to try it on your server with your LP hosted email addy and then if it works for you, then we can at least narrow it down to something with her particular domain/email addy.

But the mystery still remains ... why is she able to receive it when only 1 baby info is filled out, but not with the 2 & 3 baby info?  Weird!

leighsww

  • Guest
Php script and LP email disfunction
« Reply #22 on: April 20, 2004, 12:15:11 AM »
Lona -

Just for the heck of it, I filled out the form from the link you gave above with 3 baby info, and sent it under "test".  Let us know if you got it.

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #23 on: April 20, 2004, 05:02:03 AM »
Quote from: obsydi2
Where is $to populated?


It's not. It's hard coded in the script.
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

Offline obsydi2

  • Galactic Royalty
  • *****
  • Posts: 364
    • http://www.obsydian.com
Php script and LP email disfunction
« Reply #24 on: April 20, 2004, 05:19:08 AM »
To be precise... if it were only hardcoded, it would be hardcoded on the mail() function call. It is populated... and I assume you mean it is populated earlier in the script with a hardcoded value.

 - Virgil

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1556
    • http://www.notonebit.com
Php script and LP email disfunction
« Reply #25 on: April 20, 2004, 06:31:14 AM »
Let's not split hairs virgil, you knew what I meant.

By the way, aside from error checking for a few required fields, this is the only PHP code Lona didn't include which come before the code she posted:

Code: [Select]
/* recipients */
$to = "dzignr@prodigy.net";

/* subject */
$subject = "Baby Info";
 
/* message */
$message = "<html><head><title></title></head><body>";
$message .= "<h3>Order Form</h3>";
$message .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

Offline dezign2

  • Intergalactic Superstar
  • *****
  • Posts: 184
    • http://www.dezignconcepts.com
Php script and LP email disfunction
« Reply #26 on: April 20, 2004, 06:06:34 PM »
I received 3 test emails

1) from Virgil Green/Baby Info-1
2) test/Baby Info-1,2,3
3) from Virgil Green/Baby Info-1,2,3

Another question??? Why doesn't the script show in it's entirety for me. I am opening it in CPanel/File Manager/public html/birtht/order.php

How else should I get it??? Is there hidden information?

I'm sorry I haven't been responding to these threads quickly. Things have been very hectic for me lately. I do appreciate everyone of you helping me with this mess. This has been the way everything has worked for me from the beginning. I sometimes feel like I'm living in the Twilight Zone. :abduct:

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 #27 on: April 20, 2004, 06:20:17 PM »
To what email address? Was it to a LunarPages hosted address?

If you're not seeing the entire file, I'd suggest that you are using Show file rather than Edit. I don't trust the Show option and always use the Edit option. I haven't taken the time to properly investigate exactly *how* it acts up - I just know it gave me problems more than once and I abandoned that line of attack.


 - Virgil

Offline dezign2

  • Intergalactic Superstar
  • *****
  • Posts: 184
    • http://www.dezignconcepts.com
Php script and LP email disfunction
« Reply #28 on: April 20, 2004, 06:27:06 PM »
The emails have all been forwarded to my prodigy.net email address which is dzignr@prodigy.net.

I followed your instructions and went into "edit" and here is what I have.
Please let me know if this is it.


Code: [Select]
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<TITLE></TITLE>
<style>
td           { font-family: Verdana; font-size: 10pt }
</style>
</HEAD>
<BODY>

<?
// Error check for required fields.

if ($_POST['name'] == "" Or $_POST['submit_by'] == "")
{
echo "ERROR: You left the following fields blank:<ul>";
if ($_POST['name'] == "") echo "<li>Name";
if ($_POST['submit_by'] == "") echo "<li>Email Address";
echo "</ul>Hit your BACK button to return to form</body></html>";
exit();
}
if (!strstr($_POST['submit_by'], '@'))
{
echo "ERROR: Please enter a valid email address - hit your BACK button to return to form";
echo "</body></html>";
exit();
}


/* recipients */
//$to  = "birtht@birtht.com";
$to = "dzignr@prodigy.net";
//$to = "scanman20@hotmail.com";

/* subject */
$subject = "Baby Info";
 
/* message */
$message = "<html><head><title></title></head><body>";
$message .= "<h3>Order Form</h3>";
$message .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";

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

$message .= "<tr><td>Name: " . stripslashes($_POST['name']) . "</td></tr>";
$message .= "<tr><td>Email: " . stripslashes($_POST['submit_by']) . "</td></tr>";
$message .= "<tr><td>&nbsp;</td></tr>";

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

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


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

$message .= "</table></body></html>";
 
/* 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);
?>

<P>
<CENTER>
Thank you!<br>
Your information has been sent and I will be in touch with you soon.
<p><A HREF="http://www.birtht.com/">Home Page</A></p>
</CENTER>
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 #29 on: April 20, 2004, 06:28:28 PM »
Quote from: scanman20
Let's not split hairs virgil, you knew what I meant.


I've debugged too much code over the years to not be that precise. I'm not "splitting hairs". Too many times I've uncovered bugs where the programmer insisted there was none. Even now, you've shown me a non-LP address and I am left to assume that the same format (as opposed, maybe to '"first_name last_name" <address@domain>') was used.

 - Virgil