This topic is locked

Extra Text Field in list page

6/25/2007 3:50:57 AM
PHPRunner General questions
R
roadyx author

Hi There, This is similar to the mass mailing topics in this forum. In the list page, each selected checkbox ends up being saved as files. example: 5 checked boxes = 5 files. I managed to add a text field where a user can type input. However, I can't get the values posted by the user.

I would like to grab the user input for $btext below. Tried the following $_POST["btext"], tried $values["btext"], and in the html view, name=btext {value_btext}; To no avail.
In the HTML form:
<INPUT type=text size=140 value="-admin" name=btext>
and in function BeforeDelete (modified not to delete):
global $conn,$btext,$values;

$str = "select email from cust_table where ".$where;

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

foreach ($data as $val) {

$File = "/var/www/httpdocs/$val";

$Handle = fopen($File, 'w');

fwrite($Handle, $btext);

fclose($Handle);
}

return false;
Thanks! Roady

Alexey admin 6/25/2007

Hi,
you can use $_POST["btext"] to read user input.

Just make sure that your control appears between <form ... name="frmAdmin"> and </form> tags on the page.