Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

inputs with arrays

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

inputs with arrays

Postby xlordt » Thu Mar 27, 2003 4:44 am

I have added an array of commands.. but.. how do i check to see if what the user has inputed in to the textarea is in the array

Code: Select all

$cmd = array('0'=>'Command not found',
           'ftp'=>'Connecting to MF server', 'rename'=>'Now renaming file');
 $mfserver = "<font color=\"#FFFFFF\"><u>Mindfuk Winblows system</u>
              <br><br>C:\\ " . $c . "<br></font>";

 if ($_GET['c'] == "ftp"){
   $c .= "Connecting to MF server"; 
  $c .= "Sintax error Command not found";
    echo "<table width=\"100%\" hight=\"80%\" bgcolor=\"#000000\"><br>
      <form method=\"get\" action=\"$PHP_SELF\">
      <font color=\"#FFFFFF\">
      <input type=\"text\" name=\"c\" size=\"70%\">
User avatar
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Postby Xerpher » Thu Mar 27, 2003 7:15 am

What exactly are you asking for? how to check if the user put something in the box? how to get the contents of the box? something else?
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby Redcircle » Thu Mar 27, 2003 11:42 pm

Code: Select all
echo 'Command not found';
  echo $cmd[$_GET['c']];
User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.