stephennoble Posted August 16, 2012 Report Share Posted August 16, 2012 Hey Killer Sites Community, Pretty new to this level of programming wondering if someone knows how to fix this problem? I've been following BEN's tutorial series (Building a CMS System video 23) line for line but getting errors that Ben is not getting. I'm currently running the latest version of WAMP and PHP, My code still runs but getting this error as well.... find error screen shot in attachments FIND BELOW THE ERROR AND CODE Strict standards: Only variables should be passed by reference in C:\wamp\www\CMS\app\core\models\m_auth.php on line 34 function validateLogin($user, $pass) { global $FP; // Calling the main Database from the main $FP flight path object if ($stmt = $FP->Database->prepare("SELECT * FROM users WHERE username = ? AND password = ?")) { $stmt->bind_param("ss", $user, md5($pass . $this->salt)); // LINE 34 $stmt->execute(); $stmt->store_result(); // check for num rows if ($stmt->num_rows > 0) { // success $stmt->close(); return TRUE; } else { // failure $stmt->close(); return FALSE; } } else { die("ERROR: Could not prepare MySQLi statement."); } } Quote Link to comment Share on other sites More sharing options...
khanahk Posted August 16, 2012 Report Share Posted August 16, 2012 (edited) I'm not sure about the nature of your error. Is $salt properly defined in the class? Also, is $Database properly defined? WAMP's 'PHP Strict' errors are unlikely to cause problems on a live site (I believe, anyways). You may find that there are no errors if you put this stuff online. WAMP server is pretty picky and will complain about an 'undefined index' for something like $_POST[stuff] instead of $_POST['stuff'] , which live web host servers are fine with (as they should be..) Edited August 16, 2012 by khanahk Quote Link to comment Share on other sites More sharing options...
falkencreative Posted August 16, 2012 Report Share Posted August 16, 2012 The issue is due to this section: "md5($pass . $this->salt)". Take a look at the OOP section here for a fix: http://www.killersites.com/community/index.php?/blog/5/entry-38-variables-should-be-passed-by-reference-php-login-course-error/ Quote Link to comment Share on other sites More sharing options...
stephennoble Posted August 16, 2012 Author Report Share Posted August 16, 2012 The issue is due to this section: "md5($pass . $this->salt)". Take a look at the OOP section here for a fix: http://www.killersites.com/community/index.php?/blog/5/entry-38-variables-should-be-passed-by-reference-php-login-course-error/ CHEERS BEN..... quite a easy fix....... WAMP really throws a tantrum when you have errors on strict.... Do you think this new error occurs because i'm using a newer version, than when you made the tutorials ???? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted August 16, 2012 Report Share Posted August 16, 2012 Do you think this new error occurs because i'm using a newer version, than when you made the tutorials ???? I can't really be sure, but yes, that's my impression. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.