Jump to content
Magnifico

Contact Us Forma

Recommended Posts

Sveiki,  

Radās problēma ar kontakta formu, strādā viss izņemot attachment, aizsūtot uz email, attachments netiek pievienots, tā vietā parādās $mainīgais uz kura tam vajadzētu būt. 

Varbūt kāds var iedot piemēru kā pievienot tikai attachment vai arī pastāstīt kā izlabot šo ? 

Bildes pielikumā. 

Email2.png

Email.png

Share this post


Link to post
Share on other sites
if (isset($_FILES['uploaded_file']) &&
    $_FILES['uploaded_file']['error'] == UPLOAD_ERR_OK) {
    $mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
                         $_FILES['uploaded_file']['name']);
}

Kad suti šādi, bez foreach, tad nestrada? un ieteiktu izmantot labāk

 

 for($i = 0; $i < count($_FILES['attachments']); $i++) { echo $_FILES['attachments'][$i]['tmp_name'] }  

 

Edited by Kyrgios

Share this post


Link to post
Share on other sites

Sāc ar to, ka ieliec visu kodu, arī to daļu, kas reāli sūta e-pastu.

@Kyrgios Un ar ko tieši tavs loopošanas variants ir labāks?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.