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 08-16-2008, 06:40 AM
Tonio is offline Tonio
Registered User

Join Date: Aug 2008
Posts: 2

Controls on attached files "required"

First, congratulation for the phmailer script. Very simple and clear.
I have a question.
How modify the phmailer script to control if there is an attached file? i mean to make it required.
Reply With Quote
  #2  
Old 08-17-2008, 12:47 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

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

After this bit of code near line 237:
PHP Code:
If(trim($yourmessage)=="") { 
    
$error.="You did not enter a message!<br />";

Add this:
PHP Code:
If(empty($_FILES['attachment'])) {
    
$error.="You did not attach a file!<br />";

__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 08-21-2008, 04:57 PM
Tonio is offline Tonio
Registered User

Join Date: Aug 2008
Posts: 2

Sorry, but it seems don't work. The absence of attachment is not verified.
Reply With Quote
  #4  
Old 09-05-2008, 06:12 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
You could try this:
PHP Code:
        if(count($_FILES['attachment']) <= 0)
        {
          
$error .="You must attach a file";
        } 
what panther said should work though.
__________________

Last edited by atholon; 09-05-2008 at 06:19 PM.
Reply With Quote
  #5  
Old 10-04-2008, 07:39 PM
tonimining is offline tonimining
Registered User

Join Date: Oct 2008
Posts: 1

also this solution don't work.... someone know the solution? i need the control on attachment...
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
Tom's Hardware benchmarks Intel's first quad-core "Kentsfield" Steve Hardware and Software 0 09-11-2006 05:48 AM
Activision ordered not to show "misleading" Call of Duty ads again Steve General Chat 2 05-06-2006 11:43 AM
"pogostick" "jump-gunning" GravyFace_BMF General Chat 11 11-16-2002 05:13 PM
Why do I receive a "Cannot Initialize Provider" error when hosting a LAN game? DevilDog#1 Delta Force 0 09-09-2002 01:30 PM


All times are GMT -5. The time now is 02:28 PM.




Powered by vBulletin®