title: header location with id in php
body: <p>Is it possible to put a row ID in <code>header()</code>? I tried to put <code>header()</code> inside an <code>if</code> statement but I always got a message of: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>$result = mysqli_query($db_con,$query);
  $target="Admin/upload/otherPic/".basename($_FILES['image']['name']);
  if ($result){
      if(move_uploaded_file($_FILES['image']['tmp_name'], $target)){
          echo "&lt;script&gt;
              alert('Record updated successfully!');
              &lt;/script&gt;";
          header("Location: admin-viewacc.php?id='$result['id'];'");
      }
      else{
          echo "Error updating record: " . mysqli_error($db_con);
      }
  }
  </code></pre>