Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    54
    Thanks
    3
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    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'.
    Last edited by Redcoder; 01-27-2013 at 05:33 PM.

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    54
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    Check your mail logs too. And post the errors that are written there so that we can help you.
    Last edited by Redcoder; 01-27-2013 at 07:26 PM.

  • #5
    New Coder
    Join Date
    Aug 2005
    Posts
    54
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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

  • #6
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    Okay then.

  • #7
    New Coder
    Join Date
    Aug 2005
    Posts
    54
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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 Attached Files

  • #8
    Regular Coder
    Join Date
    Nov 2012
    Posts
    109
    Thanks
    6
    Thanked 12 Times in 12 Posts
    Maybe a silly idea, but have you checked your spamfolder?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •