Jump to content

Help with form please.


spires

Recommended Posts

Hi Guys.

 

I have a form that i'm trying to build. I need the form to generate a multi array.

The form work fine, however, for some reason the results the are being echoed out seem to have an extra \n.

 

Website:

http://adwordssupremacy.com/bulkmailer_list.php

 

Fill in the top box with:

jeff, [email protected]

tim, [email protected]

james, [email protected]

 

 

<?PHP
if (isset($_POST['submit'])){


$vars = array(
// Enter your Campaign and AdText details
"list" => "",
);

$vars['list'] = trim($_POST['list']);

$list_explode = explode("\n", $vars['list']);

$count_arr = count($list_explode);	

}
?>

<!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=ISO-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<center>
<form name="form1" method="post" action="<?PHP $_SERVER['PHP_SELF']; ?>">
<table width="700" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
  <td bgcolor="#FFFFCC" align="center"><br />
   <table width="650" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="67" height="30" align="left" valign="top"><strong>List:</strong></td>
     <td width="583" height="30"><textarea name="list" cols="67" rows="10"><?PHP echo trim($vars['list']);?></textarea></td>
    </tr>
    <tr>
     <td height="30"> </td>
     <td height="30"><input name="submit" type="submit" value="Send Email" /></td>
    </tr>
   </table>
     <br />
     <br />
  </td>
</tr>
</table>
</form>



<br><br>
<table width="700" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
  <td bgcolor="#FFFFCC" align="center"><br />
   <table width="650" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="68" height="30"  align="left" valign="top"><strong>Results:</strong></td>
     <td width="582" height="30"><textarea name="list" cols="67" rows="10"><?PHP 
for ($row = 0; $row < $count_arr; $row++){
$list_explode2 = explode(', ', $list_explode[$row]);
echo 'array( Name => "'.$list_explode2['0'].'", Email => "'.$list_explode2['1'].'"),' . "\n";
} 
?></textarea></td>
    </tr>
    <tr>
     <td height="30"> </td>
     <td height="30"></td>
    </tr>
   </table>
     <br />
     <br />
  </td>
</tr>
</table>

</center>
</body>
</html>

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/147649-help-with-form-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.