sending value by email problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maciek4
Forum Commoner
Posts: 29
Joined: Tue Apr 04, 2006 8:17 am

sending value by email problem.

Post by maciek4 »

I have 2 checkboxes and 2 drop down menus next to them with an importance factor. I want to send this info by email to myself. I wrote this code but I'm not receiving the value $importance in my email. Why?

Code: Select all

$importance = array();
 $need = array();

$mailBody .= "I need English to:\n";
        if(isset($need['friend'])) {$mailBody .= "- social reasons\n";
        $mailBody .= "Importance: ".$importance[0]."\n";}
        if(isset($need['sell'])) {$mailBody .= "- sell and negotiations\n";
$mailBody .= "Importance: ".$importance[1]."\n";}

<td bgCOLOR="#E0E0E0" class="tah11" align=left>
 <select disabled="true" name="importance">
    <option value="0" <? echo ($importance[0] == '0' ? 'selected' : '') ?>>-</option>
    <option value="1" <? echo ($importance[0] == '1' ? 'selected' : '') ?>>1</option>
    <option value="2" <? echo ($importance[0] == '2' ? 'selected' : '') ?>>2</option>
    <option value="3" <? echo ($importance[0] == '3' ? 'selected' : '') ?>>3</option>
    <option value="4" <? echo ($importance[0] == '4' ? 'selected' : '') ?>>4</option>
    <option value="5" <? echo ($importance[0] == '5' ? 'selected' : '') ?>>5</option>
    </select>
</td>

<td bgCOLOR="#E0E0E0" class="tah11" align=left>
 <select name="importance" disabled="true">
 <option value="0" <? echo ($importance[1] == '0' ? 'selected' : '') ?>>-</option>
    <option value="1" <? echo ($importance[1] == '1' ? 'selected' : '') ?>>1</option>
    <option value="2" <? echo ($importance[1] == '2' ? 'selected' : '') ?>>2</option>
    <option value="3" <? echo ($importance[1] == '3' ? 'selected' : '') ?>>3</option>
    <option value="4" <? echo ($importance[1] == '4' ? 'selected' : '') ?>>4</option>
    <option value="5" <? echo ($importance[1] == '5' ? 'selected' : '') ?>>5</option>
    </select>
</td>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

How is the submission data stored into $importance? The way it's coded here, only a single importance (the second one) will exist in submission data.
maciek4
Forum Commoner
Posts: 29
Joined: Tue Apr 04, 2006 8:17 am

Post by maciek4 »

here is what I get in my email:

I need English to:
- social reasons
Importance: 5
- sell and negotiations
Importance:

In the first one there is a value but no value in second and if I add more items then only first value appears and the rest doesnt.
Post Reply