• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[PHP+MYSQLi]What wrong on this function?

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
PHP:
<?php
include ('config/config.php');
if (!isset($accion)){
        echo'
        <body>
<form name="" method="post"
    action="reg.php?accion=registrar">
  <p>Email:<br>
    <input type="text" name="email">
  </p>
  <p>Contrase&ntilde;a:<br>
    <input type="password" name="pass">
  </p>
  <p>
    <input type="submit" name="Submit" value="Registrarse"><input type="reset" name="reset" value="Limpiar">
  </p>
</form>
';
}elseif($accion=="registrar"){
include "config/config.php";
$regUsr = "INSERT INTO cuentas VALUES (NULL, $email, $pass)";
$sql->query($regUsr);
if ($_POST) {
  $kv = array();
  foreach ($_POST as $key => $value) {
    $kv[] = "$key=$value";
  }
  $regUsr = join("&", $kv);
}
else {
  $regUsr = $_SERVER['QUERY_STRING'];
}
  echo '<h3>Congratulation, welcome to NameDomain, your email is '.$email.' and your password '.$pass.', save it and dont share never with your friends or spam emails</h3>
    </body>
    ';
}
$sql->close();
?>

Error: dont save on db :(
 
You forgot to write which field to save it at

$regUsr = "INSERT INTO cuentas (fieldname1, fieldname2, fieldname3) VALUES (NULL, $email, $pass)";
 
Back
Top