Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-08-2010, 03:44 PM
Gazza is offline Gazza
Registered User

Join Date: Jul 2009
Posts: 9

Attachment Not Attaching on phMailer Form

Can anyone provide me with some help, I have made an error in the phMailer script but can't quite find out where.

Attached in the zip file is the php page, the form I am looking to use can be located at http://www.stroudskittles.co.uk/phMailer.php

It all works well with the Result Secretary Option directing the email to the Correct address, whilst by using a Chained Menu depending on the selection selected I can limit the team names.

The problem occurs however when I atempt to submit the form as I receive the following message

JavaScript Error
Destination:Object expected
Source:http://www.stroudskittles.co.uk/phMailer.php
Line:105

see more details?

I click on the ok option, in the bottom left it states Error on Page.

The page changes and a message appears stating

Warning:Missing argument 3 for pattach(), called in /home/public_html/phMailer.php on line 258 and defined in /home/stroud/public_html/phMailer.php on line 121

The auto response to the sender is fine, the problem however is the document is not attached to the email.

Any help very much appreciated

Many Thanks
Attached Files
File Type: zip phMailer-Form.zip (6.9 KB, 1 views)
Reply With Quote
  #2  
Old 04-09-2010, 06:19 AM
Gazza is offline Gazza
Registered User

Join Date: Jul 2009
Posts: 9

Hello

I think I have this working correctly now, I'm not sure but I think their a minor error in the script?

I made a minor change in line 199 which currently reads

// Function used to attach files to the message
function phattach($file, $name, $boundary) {

I edited it to read

// Function used to attach files to the message
function phattach($file,$name) {
global $boundary;

It now works fine.

I have a couple more questions; the form does not check to see if there is an attachment; is this possible; I've tried the example on the Board but it doesn't seem to work.

Also is it possible to add Captcha as I was getting some Spam when I originally looked at using this script (V1.5)

Otherwise this is a brilliant php script

Many thanks for any assistance
Reply With Quote
  #3  
Old 04-09-2010, 07:13 AM
Gazza is offline Gazza
Registered User

Join Date: Jul 2009
Posts: 9

Forgot to add one other minor thing. Although I am using the Drop Down Menu, which is used for the Subject array, is it possible to add a common title in the Email Subject Box

i.e. If someone Selects Sections A D & E, the title in the email to the user will appear as
"Sections A D & E"

I am looking to change this so it states "Result Card For Sections A D & E"
Reply With Quote
  #4  
Old 04-09-2010, 08:07 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

The error explains exactly what the problem was:
Code:
Warning:Missing argument 3 for pattach(), called in /home/public_html/phMailer.php on line 258 and defined in /home/stroud/public_html/phMailer.php on line 121
The bug in your script comes from this line (258):
PHP Code:
$message.=phattach($_FILES['attachment']['tmp_name'][$i],$_FILES['attachment']['name'][$i]); 
It should be like this:
PHP Code:
$message.=phattach($_FILES['attachment']['tmp_name'][$i], $_FILES['attachment']['name'][$i], $boundary); 
For your other issue, you can add a third array and use that to change the actual subject.

Eg.
PHP Code:
$subjects=array("Select A Secretary""Cup Competitons""Ladies Sections""Mixed League / Cup""Sections A, D and E""Sections B, C and E");
$real_subjects=array("Select A Secretary""Result Card For Cup Competitons""Result Card For Ladies Sections""Result Card For Mixed League / Cup""Result Card For Sections A, D and E""Result Card For Sections B, C and E"); 
Then, on line 219:
PHP Code:
$emailsubject=$real_subjects[$emailsubject]; 
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #5  
Old 04-12-2010, 02:31 AM
Gazza is offline Gazza
Registered User

Join Date: Jul 2009
Posts: 9

Thanks for your help Scott it now appears to be working well.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can we submit phmailer form by using java script roop phphq.Net Forums 2 02-17-2011 08:15 PM
Adding Capatcha to PhMailer Form Gazza phphq.Net Forums 0 04-07-2010 01:58 AM
Phmailer file attachment options Frizzo phphq.Net Forums 20 10-24-2008 07:12 PM
phMailer File Attachment Label jamesr phphq.Net Forums 0 08-13-2008 03:13 AM
phMailer attachment Fallu phphq.Net Forums 3 12-25-2004 01:09 AM


All times are GMT -5. The time now is 03:10 AM.




Powered by vBulletin®