Jump to content

PHannum

New Members
  • Posts

    4
  • Joined

  • Last visited

PHannum's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your help! But now it is giving me this error: Fatal error: Call to undefined function issest() in /home/students/phannum/public_html/n413/class/Login/login.inc.php on line 10
  2. Can anyone help me as to what this means? Notice: Undefined index: logged_in in /home/students/phannum/public_html/n413/class/Login/login.inc.php on line 7 Fatal error: Call to undefined function issest() in /home/students/phannum/public_html/n413/class/Login/login.inc.php on line 10 Here is my code: <?php require_once('config.inc.php'); require_once('functions.inc.php'); session_start(); if ($_SESSION['logged_in'] == true) { redirect('#'); } else { if ((!issest($_POST['username'])) || (!issest($_POST['password'])) OR (!ctype_alnum($_POST['username'])) ) { redirect('#'); } $mysql = @new mysql($dbhost, $dbuser, $dbpwd, $dbname); if (mysqli_connect_errno()) { printf("Unable to connect to database: %s", mysqli_connect_error()); exit(); } $username = $mysqli->real_escape_string($_POST['username']); $password = $mysqli->real_escape_string($_POST['password']); $sql = "SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . md5($password) . "'"; $result = $mysqli->query($sql); if(is_object($result) && $result->num_rows == 1) { $_SESSION['logged_in'] = true; redirect('#'); } else { redirect('#'); } } ?> Thanks!
  3. I'm having trouble understanding this syntax error: Parse error: syntax error, unexpected T_STRING in /home/students/phannum/public_html/n413/ooplr/classes/Cookie.php on line 19 Here it is in my code, highlighted and bolded: <?php class Cookie { public static function exists($name) { return (issest($_COOKIE[$name])) ? true : false; } public static function get($name) { return $_COOKIE[$name]; } public static function put($name, $value, $expiry) { if(setcookie($name, $value, time() + $expiry, '/')) { return true; } return false; } public static function delete($name){ self::put($name, ',' time() - 1); } } Anything to help would be awesome!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.