This topic is locked
[SOLVED]

 DropDown

4/14/2011 5:47:05 PM
PHPRunner General questions
S
santonivich author

Hello!
I'd like to create a pulldown on one of the ADD PAGES that would contain the following code.
<?php
$dir = "/httpd/customers/virtual/xxx.com/htdocs/morning_podcasts/";;
// Open a known directory, and proceed to read its contents

if (is_dir($dir)) {

if ($dh = opendir($dir)) {

while (($file = readdir($dh)) !== false) {
echo "<option value='http://www.xxx.com/morning_podcasts/{$file}'>{$file}</option>";; //print the option

}

closedir($dh);

}

}
?>
The idea to to have the pulldown give a selection of files in a directory. What is the best way to accomplish this with PHPRunner 5.3?
Thank you in advance for any assistance.

Sergey Kornilov admin 4/14/2011

I recommend to check this article that explains how to add a custom field to the form:

http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm

S
santonivich author 4/16/2011

I've followed the directions and I have my custom drop-down working great! Thank you.
One issue: I've named my mysql database column file_name
I'm also using:
<SELECT name=file_name>

podcasts_snippet4</SELECT>
and all the event code mentions file_name in the right places. I'm not seeing the data being populated in my database. What do I need to look for?
Thanks



I recommend to check this article that explains how to add a custom field to the form:

http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm

Sergey Kornilov admin 4/17/2011

Make sure you add something like this to BeforeAdd/BeforeEdit events:

$values["file_name"]=$_REQUEST["file_name"];