student101
08-04-2008, 02:34 PM
How to get this into variable?
<?php echo $row['code']; ?>
This should work;
echo $code;
Mine isn't working - how to fix this?
while ($row = mysql_fetch_assoc($result)) {
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="5" nowrap="nowrap"><div align="center"><img src="uploads/<?php echo $row_rswish['thumb']; ?>" alt="" width="50" border="0" /></div></td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td><?php echo $row_rswish['code']; ?>
<input name="code<?php echo $x; ?>" type="hidden" id="code" value="<?php echo $row_rswish['code']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['description']; ?>
<input name="description<?php echo $x; ?>" type="hidden" id="description" value="<?php echo $row_rswish['description']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['diamondinfo']; ?>
<input name="diamondinfo<?php echo $x; ?>" type="hidden" id="diamondinfo" value="<?php echo $row_rswish['diamondinfo']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['price']; ?>
<input name="price<?php echo $x; ?>" type="hidden" id="price" value="<?php echo $row_rswish['price']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td colspan="3" valign="top" nowrap="nowrap"><hr>
<input name="------------------------<?php echo $x; ?>" type="hidden" value="------------------------" /></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap"> </td>
<td valign="top" nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr>
<td valign="top" nowrap="nowrap"> </td>
<td valign="top" nowrap="nowrap"> </td>
<td> </td>
</tr>
</table>
}
All this has to do is loop and send.
I am using this for email part;
<?php
function send_email($to='', $from='', $subject='', $html_content='', $text_content='', $headers='') {
# Setup mime boundary
$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$body = "This is a multi-part message in mime format.\n\n";
# Add in plain text version
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $text_content;
$body.= "\n\n";
# Add in HTML version
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/html; charset=\"UTF-8\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $html_content;
$body.= "\n\n";
# Attachments would go here
# But this whole email thing should be turned into a class to more logically handle attachments,
# this function is fine for just dealing with html and text content.
# End email
$body.= "--$mime_boundary--\n"; # <-- Notice trailing --, required to close email body for mime's
# Finish off headers
$headers .= "From: $from\r\n";
$headers .= "X-Sender-IP: $_SERVER[SERVER_ADDR]\r\n";
$headers .= 'Date: '.date('n/d/Y g:i A')."\r\n";
# Mail it out
return mail($to, $subject, $body, $headers);
}
?>
<?php
send_email($to='email', $from='email', $subject='My Wishlist', $html_content=$message, $text_content='My Wishlist', $headers='From:$from \r\n')
?>
<?php echo $row['code']; ?>
This should work;
echo $code;
Mine isn't working - how to fix this?
while ($row = mysql_fetch_assoc($result)) {
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="5" nowrap="nowrap"><div align="center"><img src="uploads/<?php echo $row_rswish['thumb']; ?>" alt="" width="50" border="0" /></div></td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td><?php echo $row_rswish['code']; ?>
<input name="code<?php echo $x; ?>" type="hidden" id="code" value="<?php echo $row_rswish['code']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['description']; ?>
<input name="description<?php echo $x; ?>" type="hidden" id="description" value="<?php echo $row_rswish['description']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['diamondinfo']; ?>
<input name="diamondinfo<?php echo $x; ?>" type="hidden" id="diamondinfo" value="<?php echo $row_rswish['diamondinfo']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td><?php echo $row_rswish['price']; ?>
<input name="price<?php echo $x; ?>" type="hidden" id="price" value="<?php echo $row_rswish['price']; ?>" /></td>
<td> </td>
</tr>
<tr>
<td colspan="3" valign="top" nowrap="nowrap"><hr>
<input name="------------------------<?php echo $x; ?>" type="hidden" value="------------------------" /></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap"> </td>
<td valign="top" nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr>
<td valign="top" nowrap="nowrap"> </td>
<td valign="top" nowrap="nowrap"> </td>
<td> </td>
</tr>
</table>
}
All this has to do is loop and send.
I am using this for email part;
<?php
function send_email($to='', $from='', $subject='', $html_content='', $text_content='', $headers='') {
# Setup mime boundary
$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$body = "This is a multi-part message in mime format.\n\n";
# Add in plain text version
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $text_content;
$body.= "\n\n";
# Add in HTML version
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/html; charset=\"UTF-8\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $html_content;
$body.= "\n\n";
# Attachments would go here
# But this whole email thing should be turned into a class to more logically handle attachments,
# this function is fine for just dealing with html and text content.
# End email
$body.= "--$mime_boundary--\n"; # <-- Notice trailing --, required to close email body for mime's
# Finish off headers
$headers .= "From: $from\r\n";
$headers .= "X-Sender-IP: $_SERVER[SERVER_ADDR]\r\n";
$headers .= 'Date: '.date('n/d/Y g:i A')."\r\n";
# Mail it out
return mail($to, $subject, $body, $headers);
}
?>
<?php
send_email($to='email', $from='email', $subject='My Wishlist', $html_content=$message, $text_content='My Wishlist', $headers='From:$from \r\n')
?>