Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. The output that was started at or before line 9 in top.php -
  2. The $_POST['...'] variable would match your <select name="..." attribute - $_POST['DogID']
  3. Add the following two lines of code immediately after the line with your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL);
  4. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the errors that php detects, like a header error that would prevent cookies from working, will be reported and displayed? You will save a TON of time.
  5. echo "<option value=$nt[id]>$nt[name]</option>"; ^^^ This is the code that is using what you retrieved from the query. I only see an 'id' and a 'name' field, neither of which is what you actually selected in the query.
  6. If you are referring to the query in the start of this thread, you are selecting url,ref, but those fields are not what you are using in the rest of the code.
  7. The code you posted does not produce that error. Any chance when you uploaded it to your server that the upload failed and only part of the file exists on your actual server?
  8. mysql_select_db() could be failing if "report" is not your database name or the permissions are not set for the user you connected with. You can also put some error checking logic in your code to make sure - if(!mysql_select_db("report", $con)) { die('Could not select db: ' . mysql_error()); }
  9. You can mark threads Unsolved as well.
  10. You already have a thread for this. Why start another one? You do understand that the purpose of the <?php and ?> tags are to delimit php code on the page. You can put them anywhere you want as long as the result makes sense.
  11. It's not a matter of which one is best. It's a matter of which one is correct. If php is running as an Apache Module, you use the thread-safe version. If php is running as a CGI application, you use the non-thread-safe version.
  12. You are using a URL in the include. If you are attempting to include content on the same site, you should use a file system path instead of a URL (the include will operate about 50-100 times faster.) In order to use a URL in the include, both the allow_url_fopen and allow_url_include settings must be on.
  13. It sounds like you are switching back and forth between urls that have and don't have www. in them and you have not setup the session.cookie_domain setting to match all variations of your domain and/or you have some header() redirects that don't have an exit statement after them and your code that is being executed on a page after the header() redirect is modifying the session variables.
  14. The error message is telling you where mysql found something in your query that was out of place and could not be operated on - Create, as you might imagine, has special meaning to a database - http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Either rename your column to something else or enclose it in back-ticks `` every time you put it in a query so that it will be treated as a column name instead of a keyword.
  15. A) The image you posted is using Basic HTTP Authentication. B) Using curl on your server to log in won't allow the visitor to - Which, I am guessing is why you are still getting the "Authorization Required" prompt. Using curl logs your server in. It does not log in the visitor. You could log in using curl, retrieve the data, and directly output it to the visitor. You can however, put the username password in the URL (when using Basic HTTP Authentication) and it will log them in when they are redirected to that page. This does however expose the username and password, which you might not want to do.
  16. Hard-coding something means to write line after line of same/similar code that only differs in value or name and then you must edit that list of code in order to add or change anything, instead of factoring out the common processing and using a loop to accomplish the same thing. An example would be producing a form and processing the form data. Instead of writing out all the lines of the form (hard-coding the form), you could use an array to define the form fields and then simply use a loop to produce the form and then use a similar loop when validating and processing the form data. Here is one example where probably a couple of hundreds of lines of code was reduced to a couple of tens of lines of code - http://www.phpfreaks.com/forums/index.php/topic,303004.msg1433644.html#msg1433644
  17. All you likely did was to create a more serious syntax error earlier in the file and it isn't even reaching the point that was causing your original error.
  18. You must have some idea what you changed in the code at the point in time it went from parsing without any errors to the present error?
  19. LOL, all that code looks suspect (it's repetitious, hard-coded, nondescript variable names...)
  20. Nope. That block of code does not produce a parse error (after you eliminate the first few lines that were part of a previous string.) A) I don't know what anyone would be doing putting 4000+ lines of code in one file. B) Before you attempt to work on a project that was made up of that many total lines of code, you need to develop some modular programming and organizational skills. Breaking a large project into smaller pieces would also allow you to test each individual section and you would not be faced with a - "my 4000+ line file contains a parse error and I cannot find it."
  21. http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set
  22. The fact that you started a new thread for this problem when you already have a thread, means that you lost all the information you already posted, such as the code you have tried, where this works and does not, and that it is using session variables. Some reason you did not continue with your existing thread?
  23. Your data and query works for me (just tested.) You likely have some non-printing characters as part of the data, such as a cr/lf. How did the data get put into the table?
  24. Except for check-boxes and radio-buttons, all form fields defined in a form are set, even if they are empty. Try the empty function instead. You would typically use isset to test if the form itself was submitted by checking if the submit button's name is set.
  25. You cannot use a function to supply a default value. From the mysql documentation - The disclaimer from the bottom of the w3schools web page - You can cause the current datetime to be entered into a column if you use a TIMESTAMP data type -
×
×
  • 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.