Page 1 of 1

Testing PHP

Posted: Sat Oct 25, 2003 11:23 am
by jeffcravener
I am very new to PHP. I use flash to create sites but need PHP to include some directory functionality. I found some code for reading a directory, but I am not sure how to test it since you need to have a PHP server.

Can anyone point me in the right direction?

I downloaded 'minixampp' which is supposed to enable PHP for the directory it is installed on, but how can I test this code:

Code: Select all

<? 
$handle=opendir("/pics"); 
$counter = 0; 
while ($file = readdir($handle)) &#123; 

$the_type = strrchr($file, "."); 
$is_picture = eregi("jpg",$the_type); 

if ($file != "." and $file != ".." and $is_picture) &#123; 
$pics&#1111;$counter] = $file; 
$counter++; 
&#125; 
&#125; 
closedir($handle);
for ($i = 0; $i < count($pics); $i++)&#123;
    $PicsList .= $mypics&#1111;$i] . "|";
&#125;
$PicsList = substr ($PicsList, 0, -1);

echo (&PicsList=.$PicsList.&); 
?>
so that I know it is coded properly and doing what I need it to do?

Posted: Sat Oct 25, 2003 1:31 pm
by vigge89
place the file u want to test in the htdocs folder inte xampp directory.
start your server, open up your favorite webbrowser and enter localhost/, followed by your filename in the address field. if the file exist, it will be opened in the webbrowser.

Thanks!

Posted: Sat Nov 01, 2003 9:33 am
by jeffcravener
That worked perfectly!