Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. You can also use \t to tab/indent the lines in the 'view source'
  2. You have a fatal syntax error on line 4. You should be learning php (or learning something new in php), developing php code, and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by displaying all the errors it detects. You will save a TON of time.
  3. You should be developing php code on a local development system. Constantly uploading code changes to a live server just to test what it does wastes a huge amount of development time. Code that is not fully tested often has security holes that would allow a hacker to exploit your live server. Also, a live server running with display_errors ON allows hackers to gain information about your account and server when they deliberately trigger errors. If necessary, you can set the error_reporting/display_errors settings in 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.)
  4. You already found what the output is -
  5. Why are you (attempting) to output your page contents up to the point of the header() statement, then redirect to a different page? If you could do this, it would waste your hosting bandwidth on every page request and waste the processing time it takes to generate and output that content, so you are fortunate that it does not work, your site would operate poorly. Why not just output the thank you content on the page you are already on? A header() redirect tells the browser to request the target page, the same as if you browsed to it. That in itself takes extra time.
  6. Read the error message. It tells you where the output is occurring at that is preventing the header() from working. You must find and fix whatever is causing the output.
  7. How are you storing and checking if a post is within a certain amount of time from the previous post? Edit: and if this is a search form, how are you identifying which visitor each post comes from?
  8. Your code is producing a fatal syntax error due to a missing semi-colon - You should be developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you. You will save a TON of time.
  9. There's a setting under your Profile settings in the Look and Layout section, that returns you to the post you just made, which would be what you would normally want to do after making a post -
  10. Each of your <option> tags needs a value="..." attribute to tell it what value to submit when it is selected.
  11. Assuming your deal_date column is an actual mysql DATE data type, you can use SUM(price) in the SELECT term and a GROUP BY deal_date term to give the sum for each day. You can also use a WITH ROLLUP term to give the total of all the sums. If your deal_date column is actually storing values in the format - 3/03/2010, you will find that your query will only work for a very small set of dates.
  12. Posting the query and the error it produced would certainly be a step toward someone being able to help. You should also not use the mysql PASSWORD() function for hashing passwords -
  13. The error is due to an open php language element. The most common reason is a missing or mismatched closing }, but it can also be caused by a missing closing quote, or by using short open tags <? so that some of your php code is not seen by the php parser. I suspect in your case it is because of the short open tags <?. You should only use full php opening tags <?php.
  14. It would take a specific example of your queries to directly help, but two possibilities are - 1) If the SELECT/UPDATE queries are on the same table, you can usually just perform an UPDATE query with an appropriately crafted WHERE clause and then test to make sure that the row was actually updated, or 2) You would need to lock the table(s) to insure that the values did not change between queries.
  15. For debugging purposes, add the following lines of code immediately after your first opening <?php tag in your form processing code - ini_set("display_startup_errors", "1"); ini_set("display_errors", "1"); error_reporting(E_ALL);
  16. Based on the length and the 'printing' part that var_dump() shows, you likely have a bunch of non-printing characters (probably nulls) as part of the value that are likely causing a zero to be inserted rather than the 'visible' value that you see when you echo it. A) Where is this value coming from (what is the code), and B) Use trim() on the value to remove the non-printing characters.
  17. Php internally converts any / to \ before it passes file paths to Windows. There is no need for you to use anything other than / in your code.
  18. Echo $result so that you can see what is wrong with it. The error you got is typical of the numerical variable on the end of the query being empty. If the AuctionRate column is a numeric data type, you would not want to enclose it in single-quotes in the query, especially if it is a DECIMAL data type as the single-quotes force a conversion to a FLOAT value, which can result in a floating point conversion error that the direct input of a DECIMAL data value would not have.
  19. For the php5.ini settings, max_execution_time 400 is not correct It should be - max_execution_time = 400 At what point does the Server error occur? When you request any page or just when the upload form submits to your form processing code? You can only put php settings in a .htaccess file when php is running as an Apache Module.
  20. What opening php tag is being used in the code?
  21. Perhaps if you provided more information about what the data is and why it needs to be accessed on other pages, someone could suggest the best way to handle it. List of some of the possible methods of making form data available on other pages - 1) Session 2) Database 3) Cookie 4) URL GET parameters 5) Hidden form fields
  22. Since the data being put into the query is being escaped (which it needs to be in all cases anyway), it is not possible to inject sql that would bypass the username/password check and this off track discussion about it is not relevant.
  23. http://www.phpfreaks.com/forums/index.php/topic,291146.msg1378597.html#msg1378597
  24. You already have a thread for this, don't start another thread for the same issue.
×
×
  • 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.