如何在IF STATEMENT中解决有关$ _GET [“view”]的错误? [重复]

I got error while running php file. how can I solve it? , On line if statement and at $result

The error is...

Undefined index: view in C:..\admin.php on line 46

Undefined index: view in C:..\admin.php on line 48

part of Code is as below..

<pre>
if($_GET["view"] == "administrator") {   /* line 46 */
   $result = mysql_query("SELECT * FROM administrator where adminid='$_GET[slid]'");    
   while($row1 = mysql_fetch_array($result)) {
      $adminid = $row1["adminid"];
      $password = $row1["password"];
      $adminname = $row1["adminname"];
      $address = $row1["address"];
      $contact =    $row1["contactno"];
   }
 }
 </pre>
</div>
 if(isset($_GET['view']) && $_GET['view']== "administrator")

use this if it not work than post your html code also