Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. The whole error message mentions turning off one or both of the session.bug_compat_42 and session.bug_compat_warn settings. The easiest way to deal with the problem is to turn off one or both of the session.bug_compat_42 and session.bug_compat_warn settings.
  2. The date() format string - "Y-M-D" produces 2009-Dec-Mon. You should be using "Y-m-d"
  3. Well, the code you posted is not the same logic as at the paypal link. The code at the paypal link is calling the get_magic_quotes_gpc() function and using stripslashes() if magic_quotes_gpc is ON, which is exactly what had already been posted in this thread.
  4. What's your error checking logic in your code? Is is using mysql_error() so that you would know why the query is failing?
  5. Normally this has nothing to do with the web host, you just log into the domain registration account at the domain registrar and change the name server records to point to the new hosting. If the current web host is the actual domain registrar or they are just reselling domain name registration, there should be a separate login that is different form the web hosting account.
  6. What function? You haven't shown enough information about what you are doing or how you are using the result of the query.
  7. What database class are you using, because it is fairly likely that ALL the difficulty you are having is because the database class is not directly compatible with the suggested solutions and that you should be using class methods instead.
  8. The if(function_exists('get_magic_quotes_gpc')) { code that keldorn posted is nonsense. The get_magic_quotes_gpc function exists in php4, php5, and php6, so that code will always perform stripslashes() even if the magic_quotes_gpc setting is OFF. This will result in any actual \ in the data being removed. stripslashes() should only be executed when magic_quotes_gpc in ON, in which case calling the get_magic_quotes_gpc() function will return a TRUE value.
  9. What error message does echoing mysql_error show when the INSERT query fails? There are probably a dozen possible reasons why an INSERT query could fail.
  10. An empty result would imply that $input_text is empty (anything that is not a html entity would be left as is.) Have you checked what is in $input_text. Using ENT_NOQUOTES would leave single and double quotes as is and could easily be breaking your HTML, resulting in no apparent rendered output. Have you done a "view source" of the output in your browser so that you know what it might actually be?
  11. Using two strtotime() functions is doubly-slow. If the original date can be understood by strtotime(), just do it all at once - $duedate = date('m/d/y',strtotime("{$row['inv_submitted']} +30 days")); If your inv_submitted field is in fact a DATE data type, just use the mysql DATE_ADD() function or directly add an INTERVAL in your query. To get the value formatted as a 'm/d/y', just use the mysql DATE_FORMAT() function in your query.
  12. Until you post the actual error, no one can help you with what is causing it.
  13. Umm. $row, that you fetched from the result set (using mysql_fetch_assoc or mysql_fetch_array) is already an array. Iterating over it to put each piece of it into another array is extremely pointless.
  14. Anything involving the creation, manipulation, or outputting of data is possible. That's what computers were created for. What exactly do you want to put into an array and in what form or order?
  15. What's wrong with $row['UserID']? It is a perfectly valid variable. By assigning it to another variable $UserID = $row['UserID'], you are just wasting processing time and memory.
  16. That would make the information case-insensitive, not case-sensitive.
  17. Make the comparison that is being done, case-sensitive. Since you did not post how you are accomplishing this now, it is not possible to give a specific answer. Best guess is you are using a database and comparing using a query. You would need to make the column holding the username be a binary type, such as VARBINARY, or with a collation that results in a case-sensitive comparison. I'll assume you are using an md5/sha1 of the password which would require an exact match.
  18. Echoing a FALSE value does not necessarily display anything. Use var_dump() to debug what your function returns. Your addError function is overwriting the $_SESSION['errorArray'] variable each time it is called, so it will only have the last entry. You need to use - $_SESSION['errorArray'][] = array($field => $error); Also, use real variable names in your code (not just single letters.) A week or two from now when you look at your code, you won't remember what your main code means and people in help forums won't even attempt to help troubleshoot if the problem involves figuring out what those single letter variable names mean in your code.
  19. Several threads ago, it was mentioned to you that you need to use mysql_real_escape_string on the values being put into a query in order to fix this problem. And in fact when you did use it in that thread, your query worked and inserted the data (you said.) If you had read the information at the link that was posted in that thread to the mysql_real_escape_string function in the documentation, you would have learned that it takes into account the current character encoding when it escapes data. addslashes and magic_quotes_gpc do NOT escape all the characters in all the character sets that can break a query. In fact, if magic_guotes_gpc is on, your code is not even executing the addslashes() function. If magic_quotes_gpc is ON, you should in fact use stripslashes on the data first, then unconditionally use mysql_real_escape_string - if (get_magic_quotes_gpc()) { $varItem = stripslashes($varItem); } $varItem = mysql_real_escape_string($varItem);
  20. After you convert to using a proper DATE data type, you can simply use the mysql DATEDIFF() or the TIMESTAMPDIFF() function in your query to get the number of days between any two dates.
  21. Here is a more verbose explanation - Your hosting control panel should have a section called DNS zone record/editor... You need to create an A record for your domain, something like mail.yourdomain.com that points to the IP address of your host's actual mail server. You then need to create an MX record that points to mail.yourdomain.com This will make it appear that you have a mail server by the name mail.yourdomain.com You then send mail from your php script using mail.yourdomain.com as the SMTP hostname setting (use an ini_set() statement in your script.) This should cause mail sent by your script to appear as though it is coming from your 'own' mail server.
  22. How is index.php loading (including) the other pages? Is it using a file system path or a URL in the include statement?
  23. You are re-using the $result variable inside the loop and when the code goes back to the first while() loop, the result resource in $result is that of the inner loop, not that of the outer loop. Be careful when re-using variables.
  24. Computers don't really care about that. Formats like dd-mm-yyyy or mm/dd/yyyy are human conventions and have no significance to a computer. Computers care about things like speed and storage requirements. The YYYY-MM-DD format exists for a couple of reasons - 1) When the fields (y, m, d) are in that specific left-to-right order, the values can be directly sorted and compared using less-than/greater-than comparisons, 2) By using a consistent, fixed format, the amount of storage has been minimized and the code has been optimized to result in the fastest queries. There are also a couple dozen built in data/time functions that can be used once your dates are in the expected DATE data type. To output a DATE data type in any format you want, simply use the mysql DATE_FORMAT() function in your query when you SELECT the data.
  25. Your query is missing the actual FIELD() 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.