Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. You are going to need to investigate what is happening with your data and your code on your system. Where is $result['by_id'] coming from? What is the code in between where $user_id is set and where you call the get_profile_image() function? Is this repeatable? When the same person navigates to the same point, is the result the same? Is your data in the database correct? Do you have unique data or are the results you are getting because the data is actually wrong or are there multiple values (right or wrong) for any specific id? Is the example of a id of '10' resulting in data for the id of '1' an actual case and if so, have you looked at the data for an id of 10 and an id of 1 to see if there is anything about them that would explain the results? Is the wrong value always for the same id?
  2. What exactly is wrong about them? Values for someone else? The placeholder.jpg for when the query does not return anything? And please remove the @ from in front of the mysql_ function calls as they would hide php errors that would help determine why your code is not working. The fact that you have @'s in your code suggests you are getting errors with the queries or with fetching data from the result set.
  3. borokred is the database name. Do you have a database with that name that has a table pages in it? Is the capitalization correct for both the database and the table name (in case your web host did something to cause the letter-case to become significant or different from what it previously was.)
  4. $row=mysql_fetch_assoc($result); The above line of code, before the start of your loop, is fetching and discarding the first row from the result set. Why is that line of code in your program?
  5. You already have an existing thread for this problem - http://www.phpfreaks.com/forums/index.php/topic,286765.msg1359675.html#msg1359675 Did you bother to do what I suggested for debugging the problem in that thread?
  6. Find out why the query is failing. Add an echo mysql_error(); statement on a line immediately after the mysql_query() line.
  7. The page contains 30 HTML markup errors and 25 warnings - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.dev.poolpockets.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0 Those must be fixed before you can even begin to worry about how the page looks in different browsers.
  8. You should be coping/pasting your actual code so that you don't waste everyone's time. Post the form that is submitting the data to that code. You are likely using an image as a submit button and the browsers where your code does function are actually not following the HTML specification in sending the $_POST['login'] value.
  9. Be default, the session id is passed in a cookie. Are you saying that you are not passing the session id using a cookie?
  10. The only problem in the code posted so far is that isset() must be used on a variable. You cannot use it on a function call/class method, but you would already know that if that was your actual code because php's error reporting would show a fatal runtime error.
  11. There are at least a dozen different reasons what you are doing is not working. You would need to post the actual code exhibiting the problem for anyone to even begin to have a chance at determine which one of those reasons is causing the problem in your code. xxxxxx out any sensitive information, but don't change any of the syntax or meaning of the code. Best guess is you are using a URL in your include statement for header.php and that code is not even being executed in the same scope as your main code.
  12. Did you check if register_globals were actually ON? In programming, you cannot ASSUME * anything. You must always check to make sure what a value is. It is not enough to just change a setting because there are a dozen different things that could prevent that setting from taking affect. * ASSUME = To make an ASS out of U and ME
  13. Register_globals were turned off by default nearly 8 years ago because they were the stupidest thing a programming language ever did. They have been completely removed in php6. Instead of wasting your time every time you switch servers, just spend a little time fixing your code to use the correct variable where the data is coming from, it will work on all server configurations - $cmd = $_GET['cmd']; You should also use full opening <?php tags to again keep from wasting your time every time you switch servers and the short open tag setting is not ON. Full opening tags will work on all server configurations.
  14. By default, file() includes any new-lines that are in the file. You might also have tabs or spaces as part of the data in the file. You should probably use trim() on the string before using it.
  15. <form> <form action="contact_withphp.php" method="post"> Best advice I can give is to proof read your code to make sure it is and does what you expect. Nested <form ....> tags are not valid. The first one encountered is what is used by the browser. A <form> tag with no action or method parameters submits to the current page using the GET method.
  16. Using extract($_POST); (unless you use EXTR_SKIP or EXTR_PREFIX_ALL as the second parameter) emulates what register_globals did and allows hackers to set any of your program variables to any value they want.
  17. You can only do date comparisons with dates in the format YYYY-MM-DD (most significant field is year to least significant field day.) Format the from and to dates as YYYY-MM-DD (see the mysql STR_TO_DATE() function) and then use the mysql DATE() function on the ticketdate field to only get the DATE part.
  18. $_session is just the name of an array variable on the current page. $_SESSION is the name of variables that are part of a session. In programming, just about everything has significance because computers only do exactly what their programs tell them to do.
  19. That's not what you were asked to check as the result of doing that. You were asked to check if the path and the filename is correct. Based on the results, there is no filename present and that would either indicate that $info['uploadedfile'] contains nothing or it does not exist because the column is actually named something else.
  20. Step through your code and determine what value is in $counter when it gets added to $total the first time through the loop? I'm going to guess that it should be 1 instead of 2 because you need to increment $counter after you add it to $total.
  21. http://php.net/mysql_insert_id
  22. For debugging purposes, add the following two lines of code immediately after your first opening <?php tag on the page - ini_set("display_errors", "1"); error_reporting(E_ALL);
  23. Posting a couple of pieces of code out of context does not provide enough information for anyone to determined why the function definition is not being seen. Some possible causes - 1) The function definition is in an include file and the include is failing. 2) You are including the file using a URL instead of a file system path, so the code in the file is not even present in the current scope. 3) Short open tags are being used, so the code containing the definition is not being seen as code. 4) There are no php tags at all around the code. 5) The function definitions are conditional (they are inside a conditional statement or inside of some other function definition and won't exist until that conditional statement is true or the outside function is called. 6) There is a non-printing character either in the function definition name or in the function call. Have you deleted and retyped both? Short answer: Cannot even begin to help you without seeing the whole code responsible for causing the function definition to exist.
  24. Remove the following line - global $_COOKIE; You should not bring ANY variable into a function using the global keyword and php has a built-in surprise for you when you use the global keyword on one of the super-global arrays, it does not work.
  25. We cannot tell you why the upload is failing because your code has no logic in it to test for any of the possible upload errors and tell you which one it causing the upload to fail. See this recent thread for the things you must test before you attempt to access any of the uploaded file information - http://www.phpfreaks.com/forums/index.php/topic,286370.msg1357855.html#msg1357855
×
×
  • 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.