title: jQuery $.ajax() with PHP
body: <p>I'm trying to use jQuery $.ajax() but I'm facing some difficulties.</p>
  
  <p>Here's the textbox field that I want to use for POST:</p>
  
  <pre><code>&lt;input name="url" class="url" type="text" &gt;
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>$.ajax({
          type: "post",
          url: "file.php",
          data: $(this).serialize(),
          success: function(data) { ...............
  </code></pre>
  
  <p>Now this is the file.php:</p>
  
  <pre><code>&lt;?php
  if( $_REQUEST['url'] )
  {
  
     $url = $_REQUEST['url'];
     $url = file_get_contents($url);  
     // I would need now to return something here but not sure how??!!
  }
  ?&gt;
  </code></pre>
  
  <p>Now, my question is, how to return variables in this PHP code and use them in my code above, I mean in the success part of $.ajax(). Also if I want to perform some additional stuff on the $url variable, how to do it? How to return them? :/</p>