Captive Portal and jquery
-
I am trying to capture user info when they log into the captive portal. I do not know where i went wrong??? On the following code the jquery runs a file captiveportal-x.php witch runs a INSERT to a mysql DB. When i run a test be clicking "View current page" on the captive portal page it seems to work correctly. But under normal use with a fresh browser window nothing (it does log in to the captive portal)? I have added the ip of the mysql server to the "allowed ip address" by-pass. Can anyone help???????
Thankssession_start( ); $mysessid = session_id(); ?> #PORTAL_MESSAGE# <form action="$PORTAL_ACTION$" method="post" id="testform" onsubmit="return mycall();"> User: Email: Pass: Voucher: Accept </form> print "Session number: "; print $mysessid; ?>
foreach($_POST as $key=>$val){ if(isset($val)){ ${$key} = $val;} } $db = mysql_connect("IPXXXXX", "USERNAME", "PASSWORD") or die ("cant find that database"); mysql_select_db("XXXXXX",$db) or die ("cant connect to that database"); $result = mysql_query(" INSERT INTO testtable (salutation, fname, lname, email, voucher, authorize, privacy, session) VALUES ('$salutation', '$auth_user', '$lname', '$email', '$auth_voucher', '$authorize', '$privacy', '$session') ON DUPLICATE KEY UPDATE salutation='$salutation', fname='$fname', lname='$lname', email='$email', voucher='$voucher', authorize='$authorize', privacy='$privacy';") or die(mysql_error()); ?>
-
All I want to do is post user info to a MYSQL DB before login. Is there a simple way to do this???? Someone out there must know
-
I'm not sure what the relation is between both code dumps? Can you give us some more information?
Can you see that the actual post request is done```
($.post('captiveportal-x.php', $("#testform").serialize());)To see this you need to change the return of function 'mycall' instead of 'false'