title: Cross Site Scripting Array Multiple Results
body: <p>Hello lovely people of StackOverflow,</p>
  
  <p>I built an application to store movies, so i can search for them at a later time. All is working but i'm trying to prevent XSS, I've looked at W3School htmlspecialchars, but the problem i'm running into is that i'm returning multiple fields results such a s"keywords" " category" "Date Saved" "Website". </p>
  
  <p>I can prevent XSS on only one field but then the rest of the fields don't return any data. </p>
  
  <p>Here is the code that echo's the data from the database:</p>
  
  <pre><code>    echo "&lt;tr align='center' bgcolor='#0f7ea3'&gt; 
      &lt;td height='25px'&gt;"
      .$results['Website']."&lt;/td&gt;
      &lt;td&gt;".$results['Keywords']."&lt;/td&gt;
      &lt;td&gt;".$results['Category']."&lt;/td&gt; 
      &lt;td&gt;".$results['Date Saved']."&lt;/td&gt;
      &lt;td&gt; &lt;a href='" . $results['Website'] . "'&gt;Click To Access Your Link&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;" ;
  </code></pre>
  
  <p>Hopefully I've explained my issue correctly.</p>
  
  <p>Thanks</p>