php grabbing data from javascript
<p>Apparently i try to save the data into the mysql, but it didnt work.. Anyone help?</p>

<p>create_users.php</p>

<pre><code>&lt;form method="post" action="checkAvailability.php"&gt;
 &lt;script&gt;
    var macs = { 
    getMacAddress : function() 
    { 
        document.macaddressapplet.setSep( "-" ); 
        return (document.macaddressapplet.getMacAddress()); 
    }}jQuery(document).ready(function(){ 
        var mac = macs.getMacAddress();  
        $.get('/checkAvailability.php?mac=' + mac, function() { alert('yeah done'); }) 
    }); 
&lt;/script&gt;  



&lt;script type="text/javascript"&gt;
  document.write(macs.getMacAddress());
&lt;/script&gt;
    &lt;/form&gt;
</code></pre>

<p>checkAvailability.php</p>

<pre><code>$dbhost = 'localhost';
$dbuser = 'root';
$dbname = 'registration';
mysql_connect($dbhost, $dbuser) or die("Could not connect database");
mysql_select_db($dbname);
$mac = $_GET['mac'];
$mac = mysql_real_escape_string($mac);
$sql = "INSERT INTO test(mac) VALUES ('$mac')";
mysql_query($sql);
</code></pre>
