Page 1 of 1
PHP email form suddenly not sending-webhost says it upgraded
Posted: Fri Mar 19, 2004 10:40 pm
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
Posted: Fri Mar 19, 2004 10:45 pm
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

Okay, I've learned a new thing already....
Posted: Fri Mar 19, 2004 11:37 pm
by Nethermind
Posted: Fri Mar 19, 2004 11:57 pm
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

Almost home!
Posted: Sat Mar 20, 2004 5:59 am
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
Posted: Sat Apr 10, 2004 1:31 am
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!
Posted: Sat Apr 10, 2004 1:42 am
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
Posted: Sat Apr 10, 2004 2:37 am
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