en php, me sale este error
Notice: Undefined index: user in C:\xampp\htdocs\ejemplologin\consultarusuario.php on line 4
primer php
<!-- consultarUsuario.php-->
<?php
include('functions.php');
$user=$_GET['user']; /* linea 4*/
if ($resultset = getSQLResultSet("SELECT contra FROM `usuarios` WHERE usuario='$user'")) {
while ($row = $resultset->fetch_array(MYSQLI_NUM)) {
echo json_encode($row);
}
}
?>
segundo php ##
<!-- functions.php -->
<?php
header( 'Content-Type: text/html;charset=utf-8' );
function ejecutarSQLCommand($commando){
$mysqli = new mysqli("localhost", "root", "", "ejemplologin");
/* check connection */
if ($mysqli->connect_error) {
printf("Connect failed: %s\n", $mysqli->connect_error);
echo li;
exit();
}
if ( $mysqli->multi_query($commando)) {
if ($resultset = $mysqli->store_result()) {
while ($row = $resultset->fetch_array(MYSQLI_BOTH)) {
echo listo;
}
$resultset->free();
}
}
$mysqli->close();
}
function getSQLResultSet($commando){
$mysqli = new mysqli("localhost", "root", "", "ejemplologin");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
if ( $mysqli->multi_query($commando)) {
return $mysqli->store_result();
}
$mysqli->close();
}
?>
user
cuando llamas tu archivo PHP. Debes compartir la fuente donde se recogen los datos que son enviados al servidor (formulario HTML, URL, etc).