php grabbing data from javascript
Posted: Sun Jan 24, 2010 10:55 pm
Apparently i try to save the data into the mysql, but it didnt work.. Anyone help?
create_users.php
<script type="text/javascript">
var mac = macs.getMacAddress();
$.get('/create_users.php?mac=' + mac, function() { alert('yeah done'); })
</script>
checkAvailability.php
$mac = $_GET['mac'];
$mac = mysql_real_escape_string($mac);
$sql = "INSERT INTO test(mac) VALUES ('$mac')";
mysql_query($sql);
create_users.php
<script type="text/javascript">
var mac = macs.getMacAddress();
$.get('/create_users.php?mac=' + mac, function() { alert('yeah done'); })
</script>
checkAvailability.php
$mac = $_GET['mac'];
$mac = mysql_real_escape_string($mac);
$sql = "INSERT INTO test(mac) VALUES ('$mac')";
mysql_query($sql);