Hi people.

This is driving me mad, I wrote a php script which prints out a quote using the PDFLib, it all works great till I add the correct signature.

No matter what $crm_quote_started_by_name is it uses a default of sign.jpg.

what have I done wrong?

if ($crm_quote_started_by_name == 'Matt Mitchell') {
$signature = "sign_mm.jpg" ;
}

if ($crm_quote_started_by_name == 'Helen Lloyd') {
$signature = "sign_hl.jpg" ;
}

if ($crm_quote_started_by_name == 'Barry Tilby') {
$signature = "sign_ebt.jpg" ;
}

if ($crm_quote_started_by_name == 'Peter Healy') {
$signature = "sign_pjh.jpg" ;
}

// Someone else so use a default signature

if (!$signature) {
$signature = "sign.jpg" ;
}

Thanks!

    It is usually not good to hard code this, would probably be better to have it in a database. Otherwise you have to change the code when someone joins or leaves, in a database it is much easier to handle. Anyway, I would solve this problem by using the [man]switch[/man] statement:

    switch ($crm_quote_started_by_name)
    {
    case 'Matt Mitchell':
        $signature = "sign_mm.jpg" ;
        break;
    case 'Helen Lloyd':
        $signature = "sign_hl.jpg" ;
        break:
    default:
        $signature = "sign.jpg" ;
    }

      sorted.... if i add trim($crm_started_by_name) it works fine....

      where did the white space come from???

      ah well

        markfc wrote:

        where did the white space come from???

        Well, without analyzing the rest of your code, that's anyone's guess.

        Don't forget to mark this thread resolved (if it is).

          Write a Reply...