Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   phphq.Net Forums (https://novahq.net/forum/forumdisplay.php?f=277)
-   -   Controls on attached files "required" (https://novahq.net/forum/showthread.php?t=41725)

Tonio 08-16-2008 06:40 AM

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.

Scott 08-17-2008 12:47 AM

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 />";



Tonio 08-21-2008 04:57 PM

Sorry, but it seems don't work. The absence of attachment is not verified.

atholon 09-05-2008 06:12 PM

You could try this:
PHP Code:

        if(count($_FILES['attachment']) <= 0)
        {
          
$error .="You must attach a file";
        } 

what panther said should work though.

tonimining 10-04-2008 07:39 PM

also this solution don't work.... someone know the solution? i need the control on attachment...


All times are GMT -5. The time now is 01:05 AM.

Powered by vBulletin®