Philip Posted January 14, 2013 Share Posted January 14, 2013 This topic is here for those looking for help on frequently asked questions, or just need some direction in where to find more information.Resources The official PHP website - you can find the manual here PHP Freaks main site - you can find tutorials, articles, and more there Table of Contents for FAQs Can you do / write _________ for me? Call to undefined function "mysql_connect" I'm getting a "headers already sent error". What does that mean? What is the point of MD5 / SHA1 / SHA256 / etc.? Should I salt my user's passwords, and why? mysql* expects parameter 1 to be resource, boolean given Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/ Share on other sites More sharing options...
Philip Posted January 14, 2013 Author Share Posted January 14, 2013 Can you do / write _________ for me? Sure, we could do it for you. But it is going to cost you, and better suited for the freelance forum. Instead, show us some code that you've tried or ask for guidance on what is the best way to go about something. Otherwise, don't expect anything except for snarky replies! Remember, we are volunteering our time to help you. Help us help you by at least attempting to solve the problem on your own! Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1405506 Share on other sites More sharing options...
Philip Posted January 14, 2013 Author Share Posted January 14, 2013 Call to undefined function "mysql_connect" This means your MySQL PHP library is not loaded. You should check to see if it is loaded by running phpinfo();. If it is not included, you need to check your php.ini configuration or contact your host for more information. It should be noted that mysql_ functions should be replaced with PDO library or the mysqli library. Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1405507 Share on other sites More sharing options...
Philip Posted January 14, 2013 Author Share Posted January 14, 2013 I'm getting a "headers already sent error". What does that mean? When you get this error, it means that you've already started to send content to the user and you're trying to send other header information that should be at the beginning of the request. Common situations include outputting content and trying to redirect the user later, or outputting content and then trying to set cookies. This works in javascript, because it is clientside. This doesn't work with php or other server-side languages, because cookies and redirects are sent in the header of a response, and the header goes at the beginning of the response, before content. It's like trying to dial a number to call your friend when you already called them and are in the middle of talking to them. The only thing that happens is your friend starts wondering why you're pressing random numbers. IOW the browser will not do anything with headers sent after content has already started being sent. So for example, if you try and set a cookie after outputting content, it's not going to get set. So php outputs a warning to inform you of this. So, how do you fix it? There are 2 ways; the first and preferred method, you can reorder your script so that you send the vital information (cookies, header redirects, etc.) before you send any content. The second would be to use output buffering. You can also read more about this in one of older, yet still relevant, resource topic. Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1405508 Share on other sites More sharing options...
Philip Posted January 14, 2013 Author Share Posted January 14, 2013 What is the point of MD5 / SHA1 / SHA256 / etc.? You should always, always, be hashing your users passwords. Note the word hashing and not encrypting (difference: hashing is one way and cannot be reversed.) These functions will hash a string with varying levels of security. The more processing power it takes (SHA512 will take more than MD5), the more secure it is likely to be. It should be noted that MD5 really shouldn't be used for password hashing, and instead you should be using the crypt function with a more secure algorthym (like Blowfish). Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1405509 Share on other sites More sharing options...
Philip Posted January 14, 2013 Author Share Posted January 14, 2013 Should I salt my user's passwords, and why? YES! Salting makes it much harder to crack if an attacker is using a rainbow table. Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1405510 Share on other sites More sharing options...
Philip Posted May 6, 2013 Author Share Posted May 6, 2013 mysql* expects parameter 1 to be resource, boolean givenThis means your query failed, for some reason or another. Remove any error suppressing (@), make sure you have error displaying enabled, and output mysqli_error to see specific information about your error! Link to comment https://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/#findComment-1428660 Share on other sites More sharing options...
Recommended Posts