Jump to content

php grabbing data from javascript


kennedysee

Recommended Posts

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);

Link to comment
https://forums.phpfreaks.com/topic/189687-php-grabbing-data-from-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.