PHP email form suddenly not sending-webhost says it upgraded

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Nethermind
Forum Newbie
Posts: 5
Joined: Fri Mar 19, 2004 10:40 pm

PHP email form suddenly not sending-webhost says it upgraded

Post by Nethermind »

Okay, I am a newbie at PHP, and I made an email form for a site that has been working effectively since March 2003. Suddenly, last week, the emails aren't coming anymore. When an applicant fills out the form, it appears on the webpage like all is well, but they never receive a confirmation and we never receive the form.

I contacted my web host, and they said that they upgraded their PHP and it is probably my coding that is causing the problem.

Could this be possible? After a year of receiving forms? I thought that PHP was backwards compatible. I'd hate to have to redo that form, because it's a monster.


http://www.louisianahousingassociation.org/app.htm (the application)
http://www.louisianahousingassociation.org/thanks.php (the php file)

Please let me know if anyone wants me to post the code here, but it's really quite long.

Thanks!
~Elle
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Please let me know if anyone wants me to post the code here, but it's really quite long.
Just copy thanks.php to thanks.phps on the server, then we can see the code, but i'm going to be previous and put my money on a register_globals problem ;)
Nethermind
Forum Newbie
Posts: 5
Joined: Fri Mar 19, 2004 10:40 pm

Okay, I've learned a new thing already....

Post by Nethermind »

Thanks for that tip. Here's the code:

http://www.louisianahousingassociation.org/thanks.phps
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Yeah, looks like a register_globals problem to me, to check if it is, put the following at the top of thanks.php (before the mail() call):

extract($_POST);

If that makes it work then you have a number of choices.
1. Leave the extract there so it works.
2. Use $_POST['b1email'] where you currently use $b1email, and the same goes for the other posted vars

Option 2 is preferable but option 1 is a quick fix ;)
Nethermind
Forum Newbie
Posts: 5
Joined: Fri Mar 19, 2004 10:40 pm

Almost home!

Post by Nethermind »

Well, the application was sent, thank you very much! I did the extract($_POST); just to see if it would send. The weird thing is that it didn't put the applicant's name on the page:

"Thank you, , for using our application" etc etc.

I will go back and do it the preferable way (Option 2) as you mentioned, but this will get us through the weekend.

Thanks SO much. I really don't know how I ever would have learned anything if people like you didn't share the knowledge.

Sincerely grateful,
Elle
Nethermind
Forum Newbie
Posts: 5
Joined: Fri Mar 19, 2004 10:40 pm

Post by Nethermind »

Okay, I tried the Option Two on another form, and it doesn't work. The first option didn't work either. I have tried to use it with and without the single quotes: $_POST[email]

Can anyone tell me what dumb mistakes I've made and what I need to do? I thought I had some basics of php down, but I am finding out I really don't know anything!

http://www.worldcrown.com/semidon/districtthanks.phps

Thanks!
Pozor
Forum Commoner
Posts: 74
Joined: Tue Mar 30, 2004 11:11 pm
Location: Switzerland

Post by Pozor »

Hello,

use $_POST['var'] everytime with ' ! otherwise it doesnt work.
or $var = 'variable'; $_POST[$var] is possible too.

Code: Select all

<?php
mail("$DD","Semidon Application from $name",  ......
?>
where is $DD and $DL defined? should be $_POST['DD']? (from form?)
define addresses you know, such from your company, in your skript. Then nobody can figure out the address or can abuse your skript.

greez Pozor

_______________
http://www.boelsterli.biz
Nethermind
Forum Newbie
Posts: 5
Joined: Fri Mar 19, 2004 10:40 pm

Post by Nethermind »

I used those tips, and still no luck.

http://www.worldcrown.com/semidon/districtthanks.phps

And, by defining known email addys, do you mean put in the user@domain.com where I currently have DL and DD?


Thanks,
Elle
Post Reply