title: Calling an external jQuery function from php File
body: <p>I have been trying to use Messi.js to return a pop up box if the user has an input error in a form. I have a php file called add email:</p>
  
  <pre><code>&lt;?php
  /ini_set('display_errors',1);
  //ini_set('display_startup_errors',1);
  //error_reporting(-1);
  
  include('connectionFile.php');   
  //test for duplicate emails
  $query="SELECT * FROM ClientEmail WHERE ClientEmailAddress = '" . $_POST['emailAdd'] . "'";
  $email=$_POST['emailAdd'];
  $result=mysql_query($query);
  $num=mysql_num_rows($result);
  
  if($num==0)
  {
  if(isset($_POST['emailAdd']) &amp;&amp; $_POST['emailAdd'] != "&lt;&lt;please enter email&gt;&gt;" &amp;&amp; $_POST['emailAdd'] !="")
  {
  // the form was submitted
  //remove hacker HTML
  $email=strip_tags($_POST['emailAdd']);
  
  //Insert data into database
  $sql2="INSERT INTO ClientEmail SET ClientEmailAddress='$email'";
  $result=mysql_query($sql2);
  
  }
  else
  {
  print '&lt;script type="text/javascript"&gt;'; 
  print 'new Messi("Please enter a valid email.", {title: "Input error", modal:true});'; 
  print '&lt;/script&gt;';
  
  }
  }
  else
  {
  
  print '&lt;script type="text/javascript"&gt;'; 
  print 'new Messi("Sorry, you have entered an existing email.", {title: "Duplicate Email", modal:true});'; 
  print '&lt;/script&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>I am not sure where to call the jQuery files and css. I have done so in my index.php page(where the addEmail function is called) but it is still not working.</p>
  
  <pre><code>html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;title&gt;Club Blaque - Sign up for the Revolution&lt;/title&gt;
      &lt;link href="css/reset.css" rel="stylesheet" type="text/css"&gt;
      &lt;link href="css/main.css" rel="stylesheet" type="text/css"&gt;
          &lt;link href="css/messi.min.css" rel="stylesheet" type="text/css"/&gt;
          &lt;link href="js/jquery-1.8.2.js"  type="text/javascript"/&gt;
          &lt;script src="js/messi.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>EDIT</p>
  
  <p>My form section currently looks as follows</p>
  
  <pre><code>   &lt;form name="emailAddr" method="post" action=""&gt;
          &lt;p&gt;BE INVITED TO THE REVOLUTION &lt;input id="emailAddress" name="emailAdd" type="text" value="&lt;&lt;please enter email&gt;&gt;" onFocus="clearText(this)" onblur="addText(this)"/&gt;
          &lt;button type="submit" name="submit" value="Submit"&gt;&lt;img id="submitImage"src='image/submit.ico'/&gt;&lt;/button&gt; &lt;/p&gt;
  
      &lt;/form&gt;
  </code></pre>