0

I have that code

<?php
session_start(); // Starting Session
$error=''; // Variable To Store Error Message
if (isset($_POST['submit'])) {
if (empty($_POST['username']) || empty($_POST['password'])) {
$error = ({UIkit.notify('Message...');});
}
else
{
// Define $username and $password
$username=$_POST['username'];
$password= sha1($_POST['password']);
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
include ('bd.php');
// To protect MySQL injection for Security purpose
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
// Selecting Database
// SQL query to fetch information of registerd users and finds user match.
$query = mysql_query("select * from users where password='$password' AND username='$username'", $ligabd);
$rows = mysql_num_rows($query);
if ($rows == 1) {
$_SESSION['idlogin']=$username; // Initializing Session
header("location: ../home.php"); // Redirecting To Other Page
} else {
$error = "Dados incorrectos";
}
mysql_close($ligabd); // Closing Connection
}
}
?>

I'm using uikit framework and i want to show up a notification from that framework when the user insert wrong user and pass and show that notification in the login page calling a php variable with the stored code

the code was the variable $error and the call to the notify UIkit.notify('Message...');

but in the login page if wrong user is insert nothing happens

regards in advance and sorry for my englisgh...

  • As far as I know, UIKit is the GUI-framework on iOS, something generally not available in PHP. Are you using another library/framework with the same name? Are you somehow running PHP on an iDevice? Please clarify. – 11684 Apr 27 '15 at 13:15
  • What exactly is "calling a variable"? Accesing its contents? – 11684 Apr 27 '15 at 13:16
  • 1
    `UIkit.notify('Message...')` - this is not PHP syntax. It should be either `UIkit::notify('Message...')` or `UIkit->notify('Message...')` or something else is wrong. – laurent Apr 27 '15 at 13:17
  • Did you confirm this code actually runs? Do you get any PHP errors? What is your error level? Please read this: http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php – 11684 Apr 27 '15 at 13:19
  • @this.lau_ Also, these curly braces around the UIKit statement seem suspicious. Is that valid? (Especially considering the semi-colon inside.) – 11684 Apr 27 '15 at 13:21
  • Uikit is a frontend framework for web from yootheme. Now I'm getting this error "Parse error: syntax error, unexpected '{' in /home..." – Pedro Martinho Apr 27 '15 at 21:10
  • It's Javascript See this: http://getuikit.com/docs/notify.html – Pedro Martinho Apr 27 '15 at 21:14

0 Answers0