jibicho Posted June 7, 2014 Report Share Posted June 7, 2014 I get this kind of error on trying to follow the tutorial on php login.PHP Strict Standards: Only variables should be passed by reference in /home/cifakeny/public_html/new/login.php on line 46 line 46 of login.php reads as follows, $stmt->bind_param("ss", $input['user'], md5($input['pass'] . $config['salt'])); my register.php page is clumsy and not showing the scroll values. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 7, 2014 Report Share Posted June 7, 2014 Which tutorial are you following? (I have two: a procedural login, and an OOP/MVC style login). Can you provide the line above/below line 46 as well, just so I know the context of the issue? Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 7, 2014 Author Report Share Posted June 7, 2014 i am following procedural login(only with views and includes). lines below and above 46 are as follows. else { // get and clean data from form $input['user'] = htmlentities($_POST['username'], ENT_QUOTES); $input['pass'] = htmlentities($_POST['password'], ENT_QUOTES); // create query if ($stmt = $mysqli->prepare("SELECT members.id, permissions.name FROM members, permissions WHERE username=? AND password = ? AND members.type = permissions.id")) { $stmt->bind_param("ss", $input['user'], md5($input['pass'] . $config['salt'])); $stmt->execute(); $stmt->bind_result($id, $type); $stmt->fetch(); // check if there is a match in the database for the user/password combination if ($id) { // close statement $stmt->close(); // set session variable $_SESSION['id'] = $id; $_SESSION['type'] = $type; $_SESSION['username'] = $input['user']; $_SESSION['last_active'] = time(); // redirect to member's page header("Location: members.php"); } Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 7, 2014 Report Share Posted June 7, 2014 The first thing you might try: splitting that line into two lines: $password = md5($input['pass'] . $config['salt']); $stmt->bind_param("ss", $input['user'], $password); Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 7, 2014 Author Report Share Posted June 7, 2014 Thanks for swift correspondence and support as well. the next issues are: - The disarranged register.php page with selection content display as single line in the box i.e. selectoptionadminmember and invisible password label. - The password reset link sent fails on click and shows the error: The requested URL /reset_password.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. kindly help me solve these. Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 7, 2014 Author Report Share Posted June 7, 2014 I have managed to solve the second email link related error after editing my config.php page but unfortunately i couldnt solve the first one that follows: - The disarranged register.php page with selection content display as single line in the box i.e. selectoptionadminmember and invisible password label. The distortion is hindering me from registering a member. thanks for the help so far. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 7, 2014 Report Share Posted June 7, 2014 Can you post the register.php file? Are you sure you aren't missing a quote, or that there isn't another error in your code? (a missing closing tag on an HTML element, for example? Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 8, 2014 Author Report Share Posted June 8, 2014 (edited) I have managed and reads 'member added successfully' but still gets disarranged after adding the member successfully i.e. the member is added but in case I made a mistake in feeling the form i cant pick from there, I mean I have to refresh or click back the browser. I have attached both v_register.php and register.php file. thanks for the guide so far. register.php v_register.php Edited June 8, 2014 by jibicho Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 8, 2014 Report Share Posted June 8, 2014 I've looked over the files, but as far as I can tell, they seem fine. Can you explain in more detail what the issues is? I'm not sure what you mean by "gets disarranged". What are you doing, what are you expecting, and how is the system not working the way you are expecting? Are you getting any specific error messages? Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 9, 2014 Author Report Share Posted June 9, 2014 kindly use the following details since i cant find the exact words to illustrate the behaviours. link: http://www.cifakenya.co.ke/new/login.php then use username: admin password: head try to register a member then submit and watch out the behaviours and you will notice my concerns. for me page i get after registering a member is not fit to allow further registration. i hope you understand me better now. thanks for your response. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 9, 2014 Report Share Posted June 9, 2014 OK, got it. On line 65 in register.php, add the missing ">" at the end of the line, so the </option> tag completely closes, like this: $select = '<option value="">Select an option</option>'; Do the same thing on line 73: $select .= ">" . $name . "</option>"; Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 9, 2014 Author Report Share Posted June 9, 2014 Really works well. Many thanks admin. Your support is amazing. You restored my hope to explore and love working with php. I am looking forward to learn oop on php and of course I have no fear to confront errors this time round since your instant troubleshooting is there for all. am also looking forward for a convenient hosting plan for you which i need your advice on that. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted June 9, 2014 Report Share Posted June 9, 2014 Everyone tends to have their own opinion about hosting. I've had good experiences with HostGator -- never really had a problem with down time, and their support has been helpful when I've ever needed it. Their basic plans run in the $5-$10 per month range. Stay away from GoDaddy for hosting. They are cheap, but you get what you pay for. Quote Link to comment Share on other sites More sharing options...
jibicho Posted June 10, 2014 Author Report Share Posted June 10, 2014 Thanks for your hosting plan advice. I would also like to inquire on how to integrate a forum on existing site. Also, if its possible to have a page where the admin can log in and post a job so that when public visit the site on the other end they can apply for jobs and upload their credentials. I would really appreciate if i can get a code which can do such kind of work for me. thank you in advance. 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.