Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. To return specific rows you are interested in, you must use a WHERE clause in your query - http://w3schools.com/php/php_mysql_where.asp
  2. You do understand that you can install an Apache web server, php, and mysql on just about any personal computer.
  3. In the original posted code, find the $a[] = .... line of code and add the following line right before it - $f[$i] = mysql_real_escape_string($f[$i],$this->connection); // add this line of code $a[]=trim("'$f[$i]'"); // existing line of code
  4. As was previously stated, string data that is put into the query is escaped. The whole query itself is not.
  5. All string data put into a query must be escaped so that sql special characters in it does not break the syntax of the query. See this link - http://php.net/mysql_real_escape_string
  6. Yes, well, until you investigate WHY your query is not matching a row in your table, you will never solve your problem.
  7. Have you looked directly in your database table to see if there is a row that has an exact match to what sha1($_POST["password"]) produces?
  8. Someone already answered that as well - Have you used a phpinfo() statement to find out what the actual settings are at the time your script is requested, due to any master php.ini/local php.ini/.htaccess settings?
  9. Someone already answered that -
  10. Then those settings where in your master php.ini or a local php.ini (when php is running as a CGI application) or in a .htaccess file (when php is running as an Apache Module) and they got changed because that is the only way you can have fatal parse errors reported and displayed.
  11. Since your code is never executed when there is a fatal parse error (php is a parsed, tokenized, interpreted language), how would the lines of code to set the error_reporting/display_errors settings ever get executed? You must set the error_reporting/display_errors settings before your script is requested if you want to report and display fatal parse errors.
  12. INSERT queries don't return result sets. There is nothing to fetch after an INSERT query. Why are you trying to use - $row = $result->fetch_object();
  13. This is the update syntax definition -
  14. $arrEntry['tstamp'] does not contain what you think it does. Echo $arrEntry['tstamp'] to see what is actually in it.
  15. Your links are probably inconstantly using www. or no www. on the URL's and the session.cookie_domain is not setup to match all variations of your domain -
  16. libmysql.dll is the client library that the version warning message is referring to, not the php_mysql.dll. The only unpredictable behavior of using a close but older version of the client library is that you cannot use features added in the latest version of the mysql server. Your mysql 'bin' folder should contain a libmysql.dll file that you can use.
  17. If you search for any portion of that error message you will find that it means that your query failed to execute due to an error. For debugging purposes only (remove it after you are done), echo msyql_error(); on the next line right after the line with the mysql_query() statement.
  18. You likely have an include statement that is failing (the file is either not present or was relying on the include_path setting to work) or some code is using short open tags and is no longer being seen as php code. To help narrow down some of the possible reasons, add the following two lines of code immediately after the first opening php tag in the main file - ini_set("display_errors", "1"); error_reporting(E_ALL); It would take seeing all the relevant code (i.e. the code from the start of the main file up to and including the line where the error is occurring) to be able to directly help with the problem.
  19. If your error_reporting was set to E_ALL (which it should be when learning php, developing php code, or debugging php code) you would have also gotten the following error - A leading slash on a file system path refers to the root of the current hard disk. I'm going to guess that your don't have a folder named fpdf in the root of your hard disk with that file in it. You need to either form an absolute file system path to where the file is actually at or form a relative file system path from where the main script is at or set up the include_path so that it contains an entry for where that file is at.
  20. A) You need an exit; statement after the header() redirect to prevent the remainder of the code on the page from being executed while the browser requests the target URL in the redirect. B) You likely have output occurring before the header that is preventing the header from working. Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON so that all php errors will be reported and displayed?
  21. When validating user input, where several things could be wrong at one time, it is usually better to create an array to hold the errors and to use a series of separate tests (rather than nesting tests.) You can then just test if the error array is empty to not before processing the data from the form or displaying the errors - <?php // Application values used for validation $types = array(); // array of permitted mime types $types[] = 'image/gif'; $types[] = 'image/jpeg'; $types[] = 'image/pjpeg'; // define the maximum and minimum permitted file size $max_size = 2000000; $min_size = 0; // general settings $index_name = 'uploaded_file'; // the index name of $_FILES['xxxxxx'] (for a single file upload) $errors = array(); // create an array to hold validation errors if($_FILES[$index_name]['size'] > $max_size){ $errors[] = "The size of the uploaded file {$_FILES[$index_name]['size']} is greater than the maximum permitted size $max_size<br />"; } if($_FILES[$index_name]['size'] < $min_size){ $errors[] = "The size of the uploaded file {$_FILES[$index_name]['size']} is less than the minimum permitted size $min_size<br />"; } if(!in_array($_FILES[$index_name]['type'], $types)){ $errors[] = "The mime type of the uploaded file {$_FILES[$index_name]['type']} is not one of the permitted types<br />"; } // process the file if there were no validation errors if(empty($errors)){ // no errors, process the form data here... } else { // a validation error occurred - echo "The following validation errors occurred -<br />"; foreach($errors as $error){ echo $error; } } ?>
  22. You have lumped the tests for the mime type and the size together and output one generic error message when either test fails. Separate the tests and give them their own error message so that you know which validation test is failing and display the actual value that failed as part of the error message. You will probably find that different browsers send different mime types, depending on the type of the file. You probably have a progressive jpeg image, which will result in a pjpeg mime type. You also need to check for upload errors first before you can attempt to access any of the uploaded file information. See this recent post for some code to get you started on error checking - http://www.phpfreaks.com/forums/index.php/topic,292945.msg1386624.html#msg1386624
  23. Ah ha. When all other common reasons have been eliminated, the likely reason becomes apparent... There are probably some non-printing characters stored with the data that when used in file_exists() does not match a file, but when put into a URL don't matter. Check for things like \r\n on the end of the data. As a quick test, use the trim() function - $item_benefit_1 = trim(str_replace("https://comcalc.31e.com/comcalc/", "",$benefits_img_row['item_benefit_1'])); You can also use var_dump() on $item_benefit_1 to see if the length matches the number of visible characters.
  24. Without knowing what i_view32.exe does and what the expected results should be, best guess is that you need to go into the Apache service under the Windows service control panel and check the "Allow service to interact with desktop" checkbox and restart the Apache service.
  25. If you search for any portion of that error message you will find that it means that your query failed to execute due to an error. For debugging purposes only (remove it after you are done), echo msyql_error(); on the next line right after the line with the mysql_query() statement.
×
×
  • 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.