title: Ajax Call from React to a PHP file
body: <p>I am trying to make an ajax call from my react component to a php file in which I am expecting the php file to return a specific output but instead I get an entire source code. Can someone help?</p>
  
  <p>This is what I have on my react component.</p>
  
  <pre><code>import React from 'react';
  import {Link} from 'react-router';
  
  
  export default class BikePage extends React.Component {
      onFormSubmitSuccess(e) {
        e.preventDefault();
      $.ajax({
        url: 'php/new_user.php',
        type: "GET",
        success: function(data) {
          console.log('success')
          console.log(data);
        }.bind(this),
        error: function(xhr, status, err) {
          console.log('error')
        }.bind(this)
      });
    }
  
    render(){
      return (
        &lt;button onClick={this.onFormSubmitSuccess.bind(this)} &gt;click here&lt;/button&gt;
      )
    }
  }
  </code></pre>
  
  <p>This is whats on my php file. </p>
  
  <pre><code>&lt;?php
  //Function to check if the request is an AJAX request
  $return = 'hello'
  echo json_encode($return);
  ?&gt;
  </code></pre>
  
  <p>All I am trying to test is to get the "Hello" on my console. but instead I get the entire php file. </p>