Announcement

Collapse
No announcement yet.

if

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • if

    i use this code and works, but the problem is, that the first if print a code, but execute the code of sc_mail_send, i not want, anyone explain, i want only execute print with first if.

    // Send email";

    if($email == ''){


    print("Il cliente non ha una email!!!");

    }




    if($email != ''){
    print('Email inviata');







    {
    sc_mail_send($mail_smtp_server,
    $mail_smtp_user,
    $mail_smtp_pass,
    $mail_from,
    $mail_to,
    $mail_subject,
    $mail_message,
    $mail_format);

    }

    }

  • #2
    See:
    http://php.net/manual/en/language.op...comparison.php
    http://php.net/manual/en/types.comparisons.php

    if ($email === '')
    {
    ....
    }
    else
    {
    ....
    }

    Comment


    • #3
      I must include this macro: sc_error_exit();

      if($email == ''){


      print("Il cliente non ha una email!!!");
      sc_error_exit();

      }

      Comment


      • #4
        I think this is what you are looking for:

        Code:
        if ($email == '') {
        print("Il cliente non ha una email!!!");
        } else {
        print('Email inviata');
        sc_mail_send($mail_smtp_server,
        [INDENT=2]$mail_smtp_user, [/INDENT][INDENT=2]$mail_smtp_pass, $mail_from, $mail_to, $mail_subject, $mail_message, $mail_format); [/INDENT] }
        Dave
        Dave Prue
        Code Whisperer
        Lahar International Corp
        www.lahar.net

        Comment


        • #5
          ok, works fine. If possible have an error is not possible send email if smtp not works

          Comment


          • #6
            I don't know if it works as the error starts on the socket, but you might try to set your sourcecode within a try... catch. see http://php.net/manual/en/language.exceptions.php
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              if difficult for me

              Comment

              Working...
              X