Current location: Hot Scripts Forums » Programming Languages » PHP » execute code - then mail()... HOW??


execute code - then mail()... HOW??

Reply
  #1 (permalink)  
Old 02-19-05, 11:33 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
execute code - then mail()... HOW??

i'm trying to get my email function execute my code and then email the result but i just can't get it working. how can i "pack" the code below into a $value and have that $value be sent as message body in the email?

so the question is: how do i "pack" the code below into a $value?

thank you

PHP Code:

// STEP / PAGE

$step2 $_REQUEST['step2'];

$step3 $_REQUEST['step3'];

// SELECTED abcdefS
$abcdeftype $_REQUEST['abcdeftype'];
$abcdefdevice $_REQUEST['abcdefdevice'];
$abcdefteoltype $_REQUEST['abcdefteoltype'];
$abcdefteoldevice $_REQUEST['abcdefteoldevice'];
$abcdefdev4type $_REQUEST['abcdefdev4type'];
$abcdefdev4device $_REQUEST['abcdefdev4device'];
$abcdefsnaptype $_REQUEST['abcdefsnaptype'];
$abcdefsnapdevice $_REQUEST['abcdefsnapdevice'];
$abcdefbbtype $_REQUEST['abcdefbbtype'];
$abcdefbbdevice $_REQUEST['abcdefbbdevice'];


// SELECTED boxS
$box1 $_REQUEST['box1'];
$box2 $_REQUEST['box2'];
$box3 $_REQUEST['box3'];
$box4 $_REQUEST['box4'];
$box5 $_REQUEST['box5'];
$box6 $_REQUEST['box6'];
$box7 $_REQUEST['box7'];
$box8 $_REQUEST['box8'];
$box9 $_REQUEST['box9'];
$box10 $_REQUEST['box10'];
$box11 $_REQUEST['box11'];
$box12 $_REQUEST['box12'];


// ADDRESS
$username $_REQUEST['name'];
$userstate $_REQUEST['state'];
$userzip $_REQUEST['zip'];
$userstreet $_REQUEST['street'];
$usercountry $_REQUEST['country'];
$usercity $_REQUEST['city'];
$useremail $_REQUEST['email'];
$userphone $_REQUEST['phone'];


// increasing id numbers for checkboxes
$submittedcycle $_REQUEST['cycle'];
$cycle = ($submittedcycle 1000);
$searches = ($submittedcycle 1000);


$userid $_REQUEST['userid'];

// include all global code
include '_includes/globals.php'




$font '<font size="2">';
$endfont '</font>';



// MESSAGE START

// SUMMARY START
echo '<font size="6"><b><a href="http://www.server.com/'.$userid.$useremail.'.php">'.$userid.$useremail.'</a></b></font><br>
<hr color="green">
<b>Customer:</b><br>'
.$username.'<br>'
.$userstreet.'<br>'
.$usercity.' '.$userstate.' '.$userzip.'<br>';
if (isset(
$country)){echo $usercountry.'<br>';}else{};
echo 
'<br>
<b>Email:</b><br>
<a href="mailto:'
.$useremail.'">'.$useremail.'</a><br><br>
<b>Phone:</b><br>'
.$userphone.'<br><br>';


echo 
'<b>User ID:</b><br>
'
.$userid.$useremail.'<br>
<hr color="green"><br>'
;




    
if(isset(
$_POST)) { 
// $filteritemdata => _includes/global.php
$filteritemdata;

echo 
'<table cellspacing="0" cellpadding="0" border="0" width="'.$listwidth.'">
        <tr>
            <td>item</td>
            <td>dude</td>
            <td>col</td>
        </tr>
        <tr>
            <td colspan="3"><hr color="green"></td>
        </tr>'
;

for(
$i_selitem=0;$i_selitem<count($selitemvalue); $i_selitem++) {
    echo 
'<tr><td>
    '
.$font.'<a name="'.$selcheckboxvalue[$i_selitem].'" href="_tools/linkmaker.php?'.$selcheckboxvalue[$i_selitem].'">'.$font.urldecode($selitemvalue[$i_selitem]).$endfont.'</a></td><td>'.$font.urldecode($seldudevalue[$i_selitem]).$endfont.'</td><td>'.$font.urldecode($selcolvalue[$i_selitem]).$endfont.'</td></tr>
        <tr>
            <td colspan="3"><hr color="green"></td>
        </tr>'
        
;}
        
echo 
'</table><br><br>';
        
};
    
    
echo 
'boxs:<br>
<table border="0" cellspacing="0" cellpadding="0"><tr>'
;
        
        if (isset(
$box1)){echo '<td ><input type="hidden" name="box1" value="'.$boxvalue1.'" checked></td><td><a href="_tools/boxs/box1.php" target="boxinfo" class="boxlisting">'.$boxtitle1.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost1 1;}
        
        if (isset(
$box2)){echo '<td ><input type="hidden" name="box2" value="'.$boxvalue2.'" checked></td><td><a href="_tools/boxs/box2.php" target="boxinfo" class="boxlisting">'.$boxtitle2.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost2 1;}
        
        if (isset(
$box3)){echo '<td ><input type="hidden" name="box3" value="'.$boxvalue3.'" checked></td><td><a href="_tools/boxs/box3.php" target="boxinfo" class="boxlisting">'.$boxtitle3.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost3 1;}
        
        if (isset(
$box4)){echo '<td ><input type="hidden" name="box4" value="'.$boxvalue4.'" checked></td><td><a href="_tools/boxs/box4.php" target="boxinfo" class="boxlisting">'.$boxtitle4.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost4 1;}
        
        if (isset(
$box5)){echo '<td ><input type="hidden" name="box5" value="'.$boxvalue5.'" checked></td><td><a href="_tools/boxs/box5.php" target="boxinfo" class="boxlisting">'.$boxtitle5.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost5 1;}
        
        if (isset(
$box6)){echo '<td ><input type="hidden" name="box6" value="'.$boxvalue6.'" checked></td><td><a href="_tools/boxs/box6.php" target="boxinfo" class="boxlisting">'.$boxtitle6.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost6 1;}
        
        if (isset(
$box7)){echo '<td ><input type="hidden" name="box7" value="'.$boxvalue7.'" checked></td><td><a href="_tools/boxs/box7.php" target="boxinfo" class="boxlisting">'.$boxtitle7.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost7 1;}
        
        if (isset(
$box8)){echo '<td ><input type="hidden" name="box8" value="'.$boxvalue8.'" checked></td><td><a href="_tools/boxs/box8.php" target="boxinfo" class="boxlisting">'.$boxtitle8.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost8 1;}        

        if (isset(
$box9)){echo '<td ><input type="hidden" name="box9" value="'.$boxvalue9.'" checked></td><td><a href="_tools/boxs/box9.php" target="boxinfo" class="boxlisting">'.$boxtitle9.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost9 1;}        

        if (isset(
$box10)){echo '<td ><input type="hidden" name="box10" value="'.$boxvalue10.'" checked></td><td><a href="_tools/boxs/box10.php" target="boxinfo" class="boxlisting">'.$boxtitle10.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost10 1;}        

        if (isset(
$box11)){echo '<td ><input type="hidden" name="box11" value="'.$boxvalue11.'" checked></td><td><a href="_tools/boxs/box11.php" target="boxinfo" class="boxlisting">'.$boxtitle11.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost11 1;}        

        if (isset(
$box12)){echo '<td ><input type="hidden" name="box12" value="'.$boxvalue12.'" checked></td><td><a href="_tools/boxs/box12.php" target="boxinfo" class="boxlisting">'.$boxtitle12.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost12 1;}

        
        
echo 
'</tr></table><br>
<hr color="green">'



echo 
'Selected abcdef: '

        if (
$abcdefdevice=='Select'){$selecteddevice 'abcdef '.$abcdeftype; echo $selecteddevice;}else{};
        if (
$abcdefteoldevice=='Select'){$selecteddevice 'abcdef teol '.$abcdefteoltype; echo $selecteddevice;}else{};
        if (
$abcdefdev4device=='Select'){$selecteddevice 'abcdef dev4 '.$abcdefdev4type; echo $selecteddevice;}else{};
        if (
$abcdefsnapdevice=='Select'){$selecteddevice 'abcdef snap '.$abcdefsnaptype; echo $selecteddevice;}else{};
        if (
$abcdefbbdevice=='Select'){$selecteddevice 'abcdef bb '.$abcdefbbtype; echo $selecteddevice;}else{};
        
// SUMMARY END



// cost of items selected
$totalitemcost = ($i_selitem++ * $itemcost);


// cost of boxs selected
$numberofselectedboxs = ($boxcost1 $boxcost2 $boxcost3 $boxcost4 $boxcost5 $boxcost6 $boxcost7 $boxcost8 $boxcost9 $boxcost10 $boxcost11 $boxcost12); 
$totalboxcost = ($boxcost $numberofselectedboxs);


// number of items that should be loaded onto abcdef
$itemsondevice = ($numberofselectedboxs 100 $i_selitem++ - 1); 


// cost of device selected
if ($selecteddevice == 'abcdef 20bb'){$totaldevicecost $abcdef20bb;}
if (
$selecteddevice == 'abcdef 40bb'){$totaldevicecost $abcdef40bb;}
if (
$selecteddevice == 'abcdef teol Silver'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Gold'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Green'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Blue'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Pink'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef dev4 512MB'){$totaldevicecost $abcdefdev4512mb;}
if (
$selecteddevice == 'abcdef dev4 1bb'){$totaldevicecost $abcdefdev41bb;}
if (
$selecteddevice == 'abcdef snap 40bb'){$totaldevicecost $abcdefsnap40bb;}
if (
$selecteddevice == 'abcdef snap 60bb'){$totaldevicecost $abcdefsnap60bb;}
if (
$selecteddevice == 'abcdef bb 20bb'){$totaldevicecost $abcdefbb20bb;}


// cost of total selection
$totalcostsummary = ($totalitemcost $totalboxcost $totaldevicecost $deliverycost $servicecost);

// $cycle adds the value '1000' each time the main form is loaded. for escalating item input name values
echo '<input type="hidden" name="cycle" value="'.$cycle.'">';


// SELECTED abcdefS
echo '
<input type="hidden" name="abcdefdevice" value="'
.$abcdefdevice.'">
<input type="hidden" name="abcdeftype" value="'
.$abcdeftype.'">
<input type="hidden" name="abcdefteoldevice" value="'
.$abcdefteoldevice.'">
<input type="hidden" name="abcdefteoltype" value="'
.$abcdefteoltype.'">
<input type="hidden" name="abcdefdev4type" value="'
.$abcdefdev4type.'">
<input type="hidden" name="abcdefdev4device" value="'
.$abcdefdev4device.'">
<input type="hidden" name="abcdefsnaptype" value="'
.$abcdefsnaptype.'">
<input type="hidden" name="abcdefsnapdevice" value="'
.$abcdefsnapdevice.'">
<input type="hidden" name="abcdefbbtype" value="'
.$abcdefbbtype.'">
<input type="hidden" name="abcdefbbdevice" value="'
.$abcdefbbdevice.'">';


echo 
'<hr color="green">'
.$selecteditemstotalcost.$currency.money_format('%i'$totalitemcost).
'<br>'
.$selectedboxstotalcost.$currency.money_format('%i'$totalboxcost).
'<br>'
.$selecteddevicetotalcost.$currency.money_format('%i'$totaldevicecost).'
<br>'
.$selectedservicetotalcost.$currency.money_format('%i'$servicecost).'
<br>'
.$selecteddeliverytotalcost.$currency.money_format('%i'$deliverycost).'
<br><b><font size="5">'
.$selectedtotalcost.$currency.money_format('%i'$totalcostsummary).'</font></b><br>
<hr color="green">
Total number of items on device: <b>'
.$itemsondevice.'</b><br>
<hr color="green"><br>'
;
// SUMMARY MESSAGE END




echo '</font>'
Reply With Quote
  #2 (permalink)  
Old 02-20-05, 03:32 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
what variables do you want to put in $value? because you have lots of variables!
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 02-20-05, 07:26 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
all the stuff that was in my PHP code up there, i want to be able to put all of that into one $value.


sortof like: (i put the whoel thing in brackets just to illustrate... i guess it's not supposed to be done like that.)

PHP Code:

$value = (



// STEP / PAGE
$step2 $_REQUEST['step2'];

$step3 $_REQUEST['step3'];

// SELECTED abcdefS
$abcdeftype $_REQUEST['abcdeftype'];
$abcdefdevice $_REQUEST['abcdefdevice'];
$abcdefteoltype $_REQUEST['abcdefteoltype'];
$abcdefteoldevice $_REQUEST['abcdefteoldevice'];
$abcdefdev4type $_REQUEST['abcdefdev4type'];
$abcdefdev4device $_REQUEST['abcdefdev4device'];
$abcdefsnaptype $_REQUEST['abcdefsnaptype'];
$abcdefsnapdevice $_REQUEST['abcdefsnapdevice'];
$abcdefbbtype $_REQUEST['abcdefbbtype'];
$abcdefbbdevice $_REQUEST['abcdefbbdevice'];


// SELECTED boxS
$box1 $_REQUEST['box1'];
$box2 $_REQUEST['box2'];
$box3 $_REQUEST['box3'];
$box4 $_REQUEST['box4'];
$box5 $_REQUEST['box5'];
$box6 $_REQUEST['box6'];
$box7 $_REQUEST['box7'];
$box8 $_REQUEST['box8'];
$box9 $_REQUEST['box9'];
$box10 $_REQUEST['box10'];
$box11 $_REQUEST['box11'];
$box12 $_REQUEST['box12'];


// ADDRESS
$username $_REQUEST['name'];
$userstate $_REQUEST['state'];
$userzip $_REQUEST['zip'];
$userstreet $_REQUEST['street'];
$usercountry $_REQUEST['country'];
$usercity $_REQUEST['city'];
$useremail $_REQUEST['email'];
$userphone $_REQUEST['phone'];


// increasing id numbers for checkboxes
$submittedcycle $_REQUEST['cycle'];
$cycle = ($submittedcycle 1000);
$searches = ($submittedcycle 1000);


$userid $_REQUEST['userid'];

// include all global code
include '_includes/globals.php'




$font '<font size="2">';
$endfont '</font>';



// MESSAGE START

// SUMMARY START
echo '<font size="6"><b><a href="http://www.server.com/'.$userid.$useremail.'.php">'.$userid.$useremail.'</a></b></font><br>
<hr color="green">
<b>Customer:</b><br>'
.$username.'<br>'
.$userstreet.'<br>'
.$usercity.' '.$userstate.' '.$userzip.'<br>';
if (isset(
$country)){echo $usercountry.'<br>';}else{};
echo 
'<br>
<b>Email:</b><br>
<a href="mailto:'
.$useremail.'">'.$useremail.'</a><br><br>
<b>Phone:</b><br>'
.$userphone.'<br><br>';


echo 
'<b>User ID:</b><br>
'
.$userid.$useremail.'<br>
<hr color="green"><br>'
;




    
if(isset(
$_POST)) { 
// $filteritemdata => _includes/global.php
$filteritemdata;

echo 
'<table cellspacing="0" cellpadding="0" border="0" width="'.$listwidth.'">
        <tr>
            <td>item</td>
            <td>dude</td>
            <td>col</td>
        </tr>
        <tr>
            <td colspan="3"><hr color="green"></td>
        </tr>'
;

for(
$i_selitem=0;$i_selitem<count($selitemvalue); $i_selitem++) {
    echo 
'<tr><td>
    '
.$font.'<a name="'.$selcheckboxvalue[$i_selitem].'" href="_tools/linkmaker.php?'.$selcheckboxvalue[$i_selitem].'">'.$font.urldecode($selitemvalue[$i_selitem]).$endfont.'</a></td><td>'.$font.urldecode($seldudevalue[$i_selitem]).$endfont.'</td><td>'.$font.urldecode($selcolvalue[$i_selitem]).$endfont.'</td></tr>
        <tr>
            <td colspan="3"><hr color="green"></td>
        </tr>'
        
;}
        
echo 
'</table><br><br>';
        
};
    
    
echo 
'boxs:<br>
<table border="0" cellspacing="0" cellpadding="0"><tr>'
;
        
        if (isset(
$box1)){echo '<td ><input type="hidden" name="box1" value="'.$boxvalue1.'" checked></td><td><a href="_tools/boxs/box1.php" target="boxinfo" class="boxlisting">'.$boxtitle1.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost1 1;}
        
        if (isset(
$box2)){echo '<td ><input type="hidden" name="box2" value="'.$boxvalue2.'" checked></td><td><a href="_tools/boxs/box2.php" target="boxinfo" class="boxlisting">'.$boxtitle2.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost2 1;}
        
        if (isset(
$box3)){echo '<td ><input type="hidden" name="box3" value="'.$boxvalue3.'" checked></td><td><a href="_tools/boxs/box3.php" target="boxinfo" class="boxlisting">'.$boxtitle3.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost3 1;}
        
        if (isset(
$box4)){echo '<td ><input type="hidden" name="box4" value="'.$boxvalue4.'" checked></td><td><a href="_tools/boxs/box4.php" target="boxinfo" class="boxlisting">'.$boxtitle4.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost4 1;}
        
        if (isset(
$box5)){echo '<td ><input type="hidden" name="box5" value="'.$boxvalue5.'" checked></td><td><a href="_tools/boxs/box5.php" target="boxinfo" class="boxlisting">'.$boxtitle5.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost5 1;}
        
        if (isset(
$box6)){echo '<td ><input type="hidden" name="box6" value="'.$boxvalue6.'" checked></td><td><a href="_tools/boxs/box6.php" target="boxinfo" class="boxlisting">'.$boxtitle6.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost6 1;}
        
        if (isset(
$box7)){echo '<td ><input type="hidden" name="box7" value="'.$boxvalue7.'" checked></td><td><a href="_tools/boxs/box7.php" target="boxinfo" class="boxlisting">'.$boxtitle7.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost7 1;}
        
        if (isset(
$box8)){echo '<td ><input type="hidden" name="box8" value="'.$boxvalue8.'" checked></td><td><a href="_tools/boxs/box8.php" target="boxinfo" class="boxlisting">'.$boxtitle8.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost8 1;}        

        if (isset(
$box9)){echo '<td ><input type="hidden" name="box9" value="'.$boxvalue9.'" checked></td><td><a href="_tools/boxs/box9.php" target="boxinfo" class="boxlisting">'.$boxtitle9.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost9 1;}        

        if (isset(
$box10)){echo '<td ><input type="hidden" name="box10" value="'.$boxvalue10.'" checked></td><td><a href="_tools/boxs/box10.php" target="boxinfo" class="boxlisting">'.$boxtitle10.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost10 1;}        

        if (isset(
$box11)){echo '<td ><input type="hidden" name="box11" value="'.$boxvalue11.'" checked></td><td><a href="_tools/boxs/box11.php" target="boxinfo" class="boxlisting">'.$boxtitle11.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost11 1;}        

        if (isset(
$box12)){echo '<td ><input type="hidden" name="box12" value="'.$boxvalue12.'" checked></td><td><a href="_tools/boxs/box12.php" target="boxinfo" class="boxlisting">'.$boxtitle12.'</a></td><td><img src="_images/blank.gif" width="'.$spacebetweenboxlistings.'" height="1"></td>'$boxcost12 1;}

        
        
echo 
'</tr></table><br>
<hr color="green">'



echo 
'Selected abcdef: '

        if (
$abcdefdevice=='Select'){$selecteddevice 'abcdef '.$abcdeftype; echo $selecteddevice;}else{};
        if (
$abcdefteoldevice=='Select'){$selecteddevice 'abcdef teol '.$abcdefteoltype; echo $selecteddevice;}else{};
        if (
$abcdefdev4device=='Select'){$selecteddevice 'abcdef dev4 '.$abcdefdev4type; echo $selecteddevice;}else{};
        if (
$abcdefsnapdevice=='Select'){$selecteddevice 'abcdef snap '.$abcdefsnaptype; echo $selecteddevice;}else{};
        if (
$abcdefbbdevice=='Select'){$selecteddevice 'abcdef bb '.$abcdefbbtype; echo $selecteddevice;}else{};
        
// SUMMARY END



// cost of items selected
$totalitemcost = ($i_selitem++ * $itemcost);


// cost of boxs selected
$numberofselectedboxs = ($boxcost1 $boxcost2 $boxcost3 $boxcost4 $boxcost5 $boxcost6 $boxcost7 $boxcost8 $boxcost9 $boxcost10 $boxcost11 $boxcost12); 
$totalboxcost = ($boxcost $numberofselectedboxs);


// number of items that should be loaded onto abcdef
$itemsondevice = ($numberofselectedboxs 100 $i_selitem++ - 1); 


// cost of device selected
if ($selecteddevice == 'abcdef 20bb'){$totaldevicecost $abcdef20bb;}
if (
$selecteddevice == 'abcdef 40bb'){$totaldevicecost $abcdef40bb;}
if (
$selecteddevice == 'abcdef teol Silver'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Gold'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Green'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Blue'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef teol Pink'){$totaldevicecost $abcdefteol;}
if (
$selecteddevice == 'abcdef dev4 512MB'){$totaldevicecost $abcdefdev4512mb;}
if (
$selecteddevice == 'abcdef dev4 1bb'){$totaldevicecost $abcdefdev41bb;}
if (
$selecteddevice == 'abcdef snap 40bb'){$totaldevicecost $abcdefsnap40bb;}
if (
$selecteddevice == 'abcdef snap 60bb'){$totaldevicecost $abcdefsnap60bb;}
if (
$selecteddevice == 'abcdef bb 20bb'){$totaldevicecost $abcdefbb20bb;}


// cost of total selection
$totalcostsummary = ($totalitemcost $totalboxcost $totaldevicecost $deliverycost $servicecost);

// $cycle adds the value '1000' each time the main form is loaded. for escalating item input name values
echo '<input type="hidden" name="cycle" value="'.$cycle.'">';


// SELECTED abcdefS
echo '
<input type="hidden" name="abcdefdevice" value="'
.$abcdefdevice.'">
<input type="hidden" name="abcdeftype" value="'
.$abcdeftype.'">
<input type="hidden" name="abcdefteoldevice" value="'
.$abcdefteoldevice.'">
<input type="hidden" name="abcdefteoltype" value="'
.$abcdefteoltype.'">
<input type="hidden" name="abcdefdev4type" value="'
.$abcdefdev4type.'">
<input type="hidden" name="abcdefdev4device" value="'
.$abcdefdev4device.'">
<input type="hidden" name="abcdefsnaptype" value="'
.$abcdefsnaptype.'">
<input type="hidden" name="abcdefsnapdevice" value="'
.$abcdefsnapdevice.'">
<input type="hidden" name="abcdefbbtype" value="'
.$abcdefbbtype.'">
<input type="hidden" name="abcdefbbdevice" value="'
.$abcdefbbdevice.'">';


echo 
'<hr color="green">'
.$selecteditemstotalcost.$currency.money_format('%i'$totalitemcost).
'<br>'
.$selectedboxstotalcost.$currency.money_format('%i'$totalboxcost).
'<br>'
.$selecteddevicetotalcost.$currency.money_format('%i'$totaldevicecost).'
<br>'
.$selectedservicetotalcost.$currency.money_format('%i'$servicecost).'
<br>'
.$selecteddeliverytotalcost.$currency.money_format('%i'$deliverycost).'
<br><b><font size="5">'
.$selectedtotalcost.$currency.money_format('%i'$totalcostsummary).'</font></b><br>
<hr color="green">
Total number of items on device: <b>'
.$itemsondevice.'</b><br>
<hr color="green"><br>'
;
// SUMMARY MESSAGE END




echo '</font>';



); 
Reply With Quote
  #4 (permalink)  
Old 03-03-05, 04:03 PM
JustSellMore.com JustSellMore.com is offline
New Member
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Easy stuff...

I think the best way to accomplish the task would be to write your variables/content to a file on execution, send the file "content-disposition : inline", then delete the file...

Like this:


PHP Code:

<?php

// Recipient of email

$to_email "$userid <$useremail>";


// Name your file whatever you want

$the_file "emailing.htm";

// open file for writing

$fd fopen("$the_file""wb");

// Chose the data you want written to the file

$somecontent "<font size=\"6\"><b><a href=\"http://www.server.com/".$userid.$useremail.".php\">".$userid.$useremail."</a></b></font><br>\n";
$somecontent.="<hr color=\"green\">\n";
$somecontent.="<b>Customer:</b><br>\n";

// Etc for the rest of the document



// write data to the file

fwrite($fd$somecontent);

// close the file for writing

fclose($fd);


// set boundary strings

$OB="----=_OuterBoundary_000";
$IB="----=_InnerBoundary_001";


// Send the email

    
$headers "MIME-Version: 1.0 \n"
    
$headers .= "From: \"My Name\" <myname@example.com>\n";
    
$headers .= "Content-Type: multipart/mixed;\n\tboundary=\"".$OB."\"\n";
    
$subject "Your email subject";

$recieved date('m/d/y');

$AttmFile=$the_file;
$FileName=$AttmFile;

// attachments

$Msg.= "\n--".$OB."\n";
$Msg.="Content-Type: application/octetstream;\n\tname=\"".$FileName."\"\n";
$Msg.="Content-Transfer-Encoding: base64\n";
$Msg.="Content-Disposition: inline;\n\tfilename=\"".$FileName."\"\n\n";

//file goes here

$fd=fopen ($AttmFile"r");
$FileContent=fread($fd,filesize($AttmFile));
fclose ($fd);
$FileContent=chunk_split(base64_encode($FileContent));
$Msg.=$FileContent;
$Msg.="\n\n";

//message ends

$Msg.="\n--".$OB."--\n";

// message is sent

mail("$to_email"$subject$Msg$headers);

// clear file handle

unset($fd);

// delete file

unlink($the_file);
?>
** The line "$FileContent=chunk_split(base64_encode($FileConte n t));" above should NOT have the spaces between the n and the t

Let me know if that is the answer you're looking for!

David V.
JustSellMore.com

Last edited by JustSellMore.com; 03-03-05 at 04:12 PM.
Reply With Quote
  #5 (permalink)  
Old 03-04-05, 08:59 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for the elaborate answer! i will check this out and get back to you.

best regards
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
code won't execute Bantam PHP 3 11-18-04 02:40 PM
Making a mail code Wuiqed PHP 3 09-12-04 07:45 AM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
Can you crituque my code??? NCC1701 PHP 0 05-01-04 07:03 AM
How to sale php code to customer without giving him code pradeep_soft PHP 4 03-12-04 12:10 PM


All times are GMT -5. The time now is 05:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.