Ok thanks a lot....
Here is the modified script version.....
The description is working fine (thanks again)...
But my other concern is, I wan the user to go to a different script depending on what the user selects?
I already have a couple of scripts ready to be called by this script here...
For instance, when I select "b", with the include() function in the script...this will automatically call: arraydownload.php.
Same goes for the selection "a","c","d" etc.....I don't all the choices to be pointing to only one item (site).
How to differentiate them.....???? if select "a" then call "a" site....if "b" then "b" site and so on.....
Hope I am being understood...😉
thanks again----
<?php
fwrite(STDOUT, "\nPlease Pick a site\n");
// An array of choice to sites
$sites = array (
'a'=> array("a", "Site1", "This is a site 1"),
'b'=> array("b", "Site2", "This is a site 2"),
'c'=> array("c", "Site3", "This is a site 3"),
'd'=> array("d", "Site4", "This is a site 4"),
);
echo "Enter 'q' to quit\n";
// Display the choices
foreach ( $sites as $choice ) {
echo "\t{$choice[0]}: {$choice[1]} - {$choice[2]}\n";
}
// Loop until they enter 'q' for Quit
do {
// A character from STDIN, ignoring whitespace characters
do {
$selection = fgetc(STDIN);
} while ( trim($selection) == '' );
if ( array_key_exists($selection,$sites) ) {
echo "You picked {$sites[$selection]}\n";
echo "Please wait...downloading in progress for {$sites[$selection]}\n";
include($sites[$selection] . "download.php");
}
else{ $stderr = fopen('php://stderr', 'w');
fwrite($stderr,"There was an Error\n");
fwrite($stderr,"Please try again and pick the right letter...\n");
fclose($stderr); }
} while ( $selection != 'q' );
exit(0);
?>