Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-27-2013, 04:09 PM   PM User | #1
E-Liam
New Coder

 
Join Date: Aug 2005
Posts: 54
Thanks: 3
Thanked 0 Times in 0 Posts
E-Liam is an unknown quantity at this point
php form to email not working

Hi all,

I built a time sheet submission form about three years ago, and I'm now resurrecting. It's basically so that the Steward of our club can send time sheet info to the treasurer rather than drop it round her house. I'm fairly sure it was working when I first wrote it, but it was a while ago. It doesn't need to be particularly secure, as I'll pw protect the page it once it's all up and running, and not all of the fields will ever all need completing.

Any blindingly obvious errors?

http://www.hanworthclub.co.uk/wagessheettest.php

is the form. (HTML/CSS all validated)

and the PHP..
PHP Code:
<?php
$Day
=$_POST['Day'];
$Month=$_POST['Month'];
$year=$_POST['Year'];

$JSHol=$_POST['JSHol'];
$KRHol=$_POST['KRHol'];

$MonS1=$_POST['MonS1'];
$MonS2=$_POST['MonS2'];
$TueS1=$_POST['TueS1'];
$TueS2=$_POST['TueS2'];
$WedS1=$_POST['WedS1'];
$WedS2=$_POST['WedS2'];
$ThuS1=$_POST['ThuS1'];
$ThuS2=$_POST['ThuS2'];
$FriS1=$_POST['FriS1'];
$FriS2=$_POST['FriS2'];
$FriS2H=$_POST['FriS2H'];
$SatS1=$_POST['SatS1'];
$SatS2=$_POST['SatS2'];
$SunLS1=$_POST['SunLS1'];
$SunLS1H=$_POST['SunLS1H'];
$SunLS2=$_POST['SunLS2'];
$SunLS2H=$_POST['SunLS2H'];
$SunES1=$_POST['SunES1'];
$SunES2=$_POST['SunES2'];

$SatAftS1=$_POST['SatAftS1'];
$SatAftS1H=$_POST['SatAftS1H'];
$SatAftS2=$_POST['SatAftS2'];
$SatAftS2H=$_POST['SatAftS2H'];

$SatFuncS1=$_POST['SatFuncS1'];
$SatFuncS1H=$_POST['SatFuncS1H'];
$SatFuncS2=$_POST['SatFuncS2'];
$SatFuncS2H=$_POST['SatFuncS2H'];

$WeeklyCleanH=$_POST['WeeklyCleanH'];
$WeeklyClean=$_POST['WeeklyClean'];
$AltClean=$_POST['AltClean'];
$FuncCleanH=$_POST['FuncCleanH'];
$FuncClean=$_POST['FuncClean'];
$AltFuncClean=$_POST['AltFuncClean'];

$BHMonS1=$_POST['BHMonS1'];
$BHMonS1H=$_POST['BHMonS1H'];
$BHFriS1=$_POST['BHFriS1'];
$BHFriS1H=$_POST['BHFriS1H'];

$XmasDayS1=$_POST['XmasDayS1'];
$XmasDayS1H=$_POST['XmasDayS1H'];
$XmasDayS2=$_POST['XmasDayS2'];
$XmasDayS2H=$_POST['XmasDayS2H'];

$BoxDayLS1H=$_POST['BoxDayLS1H'];
$BoxDayLS1=$_POST['BoxDayLS1'];
$BoxDayLS2H=$_POST['BoxDayLS2H'];
$BoxDayLS2=$_POST['BoxDayLS2'];

$BoxDayES1H=$_POST['BoxDayES1H'];
$BoxDayES1=$_POST['BoxDayES1'];
$BoxDayES2H=$_POST['BoxDayES2H'];
$BoxDayES2=$_POST['BoxDayES2'];

$NYDayLS1H=$_POST['NYDayLS1H'];
$NYDayLS1=$_POST['NYDayLS1'];
$NYDayLS2H=$_POST['NYDayLS2H'];
$NYDayLS2=$_POST['NYDayLS2'];

$NYDayES1H=$_POST['NYDayES1H'];
$NYDayES1=$_POST['NYDayES1'];
$NYDayES2H=$_POST['NYDayES2H'];
$NYDayES2=$_POST['NYDayES2'];

$NYEveS1H=$_POST['NYEveS1H'];
$NYEveS1=$_POST['NYEveS1'];
$NYEveS2H=$_POST['NYEveS2H'];
$NYEveS2=$_POST['NYEveS2'];
$NYEveS3H=$_POST['NYEveS3H'];
$NYEveS3=$_POST['NYEveS3'];
$NYEveS4H=$_POST['NYEveS4H'];
$NYEveS4=$_POST['NYEveS4'];


$subject "Wages Sheet: Week ending: Sunday, $Day $Month $Year.";
$sendto "recipient@wherever.com";
$from "Scottie";
$body "This is the staff wages information for the week ending: Sunday, $Day $Month $Year.

-------------------------------------------------------------------------

Holidays taken this week.

Holidays taken by John Scott: $JSHol
Holidays taken by Kath Robinson: $KRHol

-------------------------------------------------------------------------

Standard Shifts worked this week.

Monday; Shift One: 4.75 Hours: $MonS1 
Monday; Shift Two: 2.75 Hours: $MonS2 

Tuesday; Shift One: 4.75 Hours: $TueS1 
Tuesday; Shift One: 4.75 Hours: $TueS2 

Wednesday; Shift One: 4.25 Hours: $WedS1 
Wednesday; Shift Two: 2.75 Hours: $WedS2 

Thursday; Shift One: 4.25 Hours: $ThuS1 
Thursday; Shift Two: 2.75 Hours: $ThuS2 

Friday; Shift One: 4.25 Hours: $FriS1 
Friday; Shift Two: $FriS2H: $FriS2 

Saturday; Shift One: 5.75 Hours: $SatS1 
Saturday; Shift Two: 3.75 Hours: $SatS2 

Sunday Lunch; Shift One: $SunLS1H: $SunLS1 
Sunday Lunch; Shift Two: $SunLS2H: $SunLS2 

Sunday Evening; Shift One: 4.25 Hours: $SunES1 
Sunday Evening; Shift Two: 2.75 Hours: $SunES2 

Saturday Cleaner: $WeeklyCleanH : $WeeklyClean : $AltClean

-------------------------------------------------------------------------

Saturday Afternoon; Shift One: $SatAftS1H: $SatAftS1 
Saturday Afternoon; Shift Two: $SatAftS2H: $SatAftS2 

-------------------------------------------------------------------------

Saturday Function; Shift One: $SatFuncS1H: $SatFuncS1 
Saturday Function; Shift Two: $SatFuncS2H: $SatFuncS2 

Saturday Function Cleaner: $FuncCleanH: $FuncClean : $AltFuncClean

-------------------------------------------------------------------------

Bank Holiday Monday; Shift One: $BHMonS1H: $BHMonS1 
Bank Holiday Monday; Shift Two: $BHMonS2H: $BHMonS2 

-------------------------------------------------------------------------

Bank Holiday Friday; Shift One: $BHFriS1H: $BHFriS1 
Bank Holiday Friday; Shift Two: $BHFriS2H: $BHFriS2 

-------------------------------------------------------------------------

Christmas Day; Shift One: $XmasDayS1H: $XmasDayS1
Christmas Day; Shift Two: $XmasDayS2H: $XmasDayS2

-------------------------------------------------------------------------

Boxing Day Lunch; Shift One: $BoxDayLS1H: $BoxDayLS1
Boxing Day Lunch; Shift Two: $BoxDayLS2H: $BoxDayLS2

Boxing Day Evening; Shift One: $BoxDayES1H: $BoxDayES1
Boxing Day Evening; Shift Two: $BoxDayES2H: $BoxDayES2

-------------------------------------------------------------------------

New Years Day Lunch; Shift One: $NYDayLS1H: $NYDayLS1
New Years Day Lunch; Shift Two: $NYDayLS2H: $NYDayLS2

New Years Day Evening; Shift One: $NYDayES1H: $NYDayES1
New Years Day Evening; Shift Two: $NYDayES2H: $NYDayES2

-------------------------------------------------------------------------

New Years Eve; Shift One: $NYEveS1H: $NYEveS1
New Years Eve; Shift Two: $NYEveS2H: $NYEveS2
New Years Eve; Shift Three: $NYEveS3H: $NYEveS3
New Years Eve; Shift Four: $NYEveS4H: $NYEveS4

New Years Day Cleaner: $NYDayCleanH: $NYDayClean : $AltNYDayClean

-------------------------------------------------------------------------

"

;
mail($sendto,$subject,$body);
header"Location: wagesuccess.shtml" );
?>
Any help gratefully received,

Cheers

Last edited by E-Liam; 01-27-2013 at 07:10 PM.. Reason: Typo
E-Liam is offline   Reply With Quote
Old 01-27-2013, 05:29 PM   PM User | #2
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
First, check whether the server is configured to mail(). Check phpinfo() and look at sendmail_path. Should be something like this: /usr/sbin/sendmail -t -i. And sendmail_from which should be something like testaddress@example.com

Also on submit it says that 'wagessuccess.shtml cannot be found on that server'.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk

Last edited by Redcoder; 01-27-2013 at 05:33 PM..
Redcoder is offline   Reply With Quote
Old 01-27-2013, 07:17 PM   PM User | #3
E-Liam
New Coder

 
Join Date: Aug 2005
Posts: 54
Thanks: 3
Thanked 0 Times in 0 Posts
E-Liam is an unknown quantity at this point
Hi Recoder, thanks for the reply.

sendmail_path = /usr/sbin/sendmail -t -i
sendmail_from = no value

wagessuccess.shtml was a typo (apologies) should be wagesuccess.shtml. Changed both in the post above, and live. On clicking submit it redirects to that page now, but I still don't receive an email submission from the form.

Update: I had a thought, and uploaded a small contact form I'd written for another site, along with the corresponding php file, and that works fine, so the mechanics all work, it's just a problem with the code I've written for this form.

Many thanks again for your help,

Cheers

Last edited by E-Liam; 01-27-2013 at 07:27 PM.. Reason: update to the post
E-Liam is offline   Reply With Quote
Old 01-27-2013, 07:24 PM   PM User | #4
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
Check your mail logs too. And post the errors that are written there so that we can help you.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk

Last edited by Redcoder; 01-27-2013 at 07:26 PM..
Redcoder is offline   Reply With Quote
Old 01-27-2013, 10:33 PM   PM User | #5
E-Liam
New Coder

 
Join Date: Aug 2005
Posts: 54
Thanks: 3
Thanked 0 Times in 0 Posts
E-Liam is an unknown quantity at this point
Hi Recoder,

I can't remember the url for the Control Panel off the top of my head, so I'll find that and get back to you tomorrow.

Cheers

Liam
E-Liam is offline   Reply With Quote
Old 01-27-2013, 10:59 PM   PM User | #6
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
Okay then.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk
Redcoder is offline   Reply With Quote
Old 01-28-2013, 08:19 PM   PM User | #7
E-Liam
New Coder

 
Join Date: Aug 2005
Posts: 54
Thanks: 3
Thanked 0 Times in 0 Posts
E-Liam is an unknown quantity at this point
Hi Recoder,

here are the error logs attached. I had to split the file as it was a little over sized as one. This is just the errors pertaining to the page from yesterday.

Cheers, and thanks again

Liam
Attached Files
File Type: txt errorlog.txt (49.0 KB, 8 views)
File Type: txt errorlog2.txt (1.4 KB, 9 views)
E-Liam is offline   Reply With Quote
Old 01-28-2013, 08:46 PM   PM User | #8
Thyrosis
New Coder

 
Join Date: Nov 2012
Posts: 72
Thanks: 4
Thanked 11 Times in 11 Posts
Thyrosis is on a distinguished road
Maybe a silly idea, but have you checked your spamfolder?
Thyrosis is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:40 PM.


Advertisement
Log in to turn off these ads.