I'm making a webpage to send a list of email addresses to each user. I have a script called add_book.php
to allow me to input a list of email addresses in the message like this:
I want to output a list of email addresses to input each of them in the textbox include with a comma when I click on the button to allow me to input the list of email addresses in the script called email.php, but I have no idea how to do this.
Like this:
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Email Addresses...</title>
</head>
<body>
<table>
<tr>
<td><textarea name="message" cols="50" rows="20"></textarea></td>
</tr>
<td colspan="2" align="left">
<input type="submit" name="send" value="Add Email" style="height:35px; width:100px">
</td>
</table>
</form>
</body>
Here is the code for the email.php script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Send Email</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<form action="pr_send.php" method="POST">
<table>
<!-- <tr>
<td>From:</td>
<td><input type="text" name="from"></td>
</tr> -->
<tr>
<td><input type="button" name="to" value="" style="height:24px; width:24px; background:url('addressbook.png'); border:none;" onClick="Popup()"> To:</td>
<td><input type="text" name="to" style="height:15px; width:650px"></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type="text" name="subject" style="height:15px; width:650px"></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name="message" cols="90" rows="20"></textarea></td>
</tr>
<tr>
</br>
<td colspan="2" align="left">
<input type="submit" name="send" value="" style="height:35px; width:100px; background:url('send.png'); border:none">
</td>
</tr>
</table>
</form>
</body>
<script type="text/javascript">
function Popup()
{
window.open("add_address.php", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=500, width=400, height=400");
}
</script>
</html>
Here is the textbox that I want to output with a list of email addresses:
<td><input type="text" name="to" style="height:15px; width:650px"></td>
Can you please help me how I can extract a list of email addresses with a comma to output them in the textbox from the script add_address.php to my script called email.php?