Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. And if you set error_reporting to E_ALL you will also be getting notice error messages about the variables that are not set.
  2. Your code is unconditionally echoing the "You are logged out successfully" message, regardless of if you actually logged out. Did you determine why you could not set cookies in your previous thread, because that may also tell us why you cannot clear the cookies (which is actually just setting the cookie with a time in the past.) You should also NOT have a cookie named 'AdminCookie' because someone will just set that cookie and take over your site. Some of the first open source scripts, like phpbb did this and a lot of web sites were taken over because all you need to do is create a cooke that says you are the administrator to a site. You should rely only on a value stored on the server to determine if any logged in visitor is an administrator. You should just set a unique value in the cookie to identify each visitor and control the logged in/logged out status ONLY using a value stored on the server. The unique value you use should not be easy to guess or reproduce. It should not be a simple integer, such as the auto-increment value from your user table. See the uniqid function for how you might generate a unique and hard to guess and hard to reproduce id.
  3. Given that the path the script is trying to use to access the preferences.conf file is substantially different from the path where the script is actually running at, I would say you probably skipped an installation step of entering the actual path into a configuration file somewhere. And assuming that the script is open source, providing a link to the Author's site would be helpful. If it is a purchased script, you should probably be asking the Author for support, not some general php help forum.
  4. You would add it to the ORDER BY term in the query - ORDER BY field_4 DESC, your_other_field_here You can add DESC after the second field if you want it to be ordered descending. The above will first order the rows by field_4 DESC, then within each same field_4 value, it will order the rows by the next field you specify.
  5. http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_in
  6. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=319274.0
  7. Moving this thread to the Ajax forum section, since this has nothing to do with the php part of your code...
  8. You need to use mysql_num_rows() to find out if your query matched any rows. You should only process the results of the query if there are any rows and if you are getting zero rows, but you think your query should return something, you would need to troubleshoot why your query is not matching any rows.
  9. You don't output the image data in the <img src="..."> tag. The src="..." attribute takes a URL that results in the image being output - http://w3schools.com/html/html_images.asp You would put your code that outputs the Content-type header followed by the image data into it's own .php file and you would use the URL of that file in the src="..." attribute. Also, don't use GD functions just to output an image unless you need to manipulate the image using GD functions. GD functions take a huge amount of memory and processing time.
  10. To just get the date part of a datetime value when you select the data, use the mysql DATE() function in your query - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date However, since you are probably formatting the date into some format other than YYYY-MM-DD, use the mysql DATE_FORMAT() function in your query - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format No slow parsed, tokenized, interpreted php code is needed. Doing this in your query is at least 8 times faster than using php code.
  11. ^^^ Is there some reason you are making your data_validateUserName() function a static method?
  12. Someone already provided an answer to your problem -
  13. In the code you posted, $mdb2 in only a local variable within the __construct() function. To make it a class variable, you would need to declare it as a class variable (for example a private variable) - class MyClass { private $mdb2; ..... } Then you would reference it everywhere within the class using $this->mdb2 - $this->mdb2 =& MDB2::singleton($dsn);
  14. Did you refresh the page with the code on it that dragon_sa posted, because the $_COOKIE variable is set when the browser sends the cookie with the HTTP request, not when you execute a setcookiei() statement. Any chance you have disabled cookies in your browser for the domain you are testing this on?
  15. You would use the Windows task scheduler.
  16. Topics are not deleted once they are solved in case the problem and solution would help someone else. BTW: Someone posted the most likely section of code responsible for the symptom. I guess you failed to read that. And I marked the thread solved for you...
  17. ^^^ That if() statement calls the function and tests the result of the function call. Your most likely problem is the leading slash on your $upfile value refers to the root of the current hard disk and it is unlikely that is where your destination folder actually is. Are you developing and testing this code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the php detected errors will be reported and displayed? Doing so would show any errors that are occurring with the move_uploaded_file() statement.
  18. See this post - http://www.phpfreaks.com/forums/php-coding-help/please-help-mysql-syntax-error-in-the-insertion/msg1504690/#msg1504690
  19. So, did you use the pseudo code that someone posted to retrieve the rows from your database and output the date headings followed by the data under each date? That would be the first step. Outputting the necessary HTML tags to start/close the table and to put table headers <tr><th>...</th></tr> around the date headers and table rows <tr><td>...</td></tr> around the data would then only involve minor changes to the code to produce the following - <table> <tr><th>Header row1</th></tr> <tr><td>data row 1</td></tr> <tr><td>data row 2</td></tr> ... <tr><th>Header row2</th></tr> <tr><td>data row 1</td></tr> <tr><td>data row 2</td></tr> ... </table>
  20. ajaxobject.responseText is how you access the response that is sent back from the web server. In some of the other random changes you made to your code, you removed the reference to ajaxobject.responseText
  21. Of course we have a clue how to output a table, but we are not here to write your code for you. What exact part of having php output the data in a table do you need help with? Did you attempt to do this with your actual query/database/columns?
  22. You forgot to type the 'php' on the <?php tag near the end of your code and the closing } was not seen as being php code by the php parser.
  23. I'm going to guess that your code is actually redirecting to index1.php, but that index1.php is redirecting back to the page you posted in this thread. Have you actually checked in your bowser if the cookie exists and what value is in it? I suspect it is getting created with an empty() value and the code is doing what it is supposed to be doing (skipping the login code if the cookie isset() but displaying the login form if the value is empty().) You need to check what $row['LoginId'] actually contains. Either it is a value that the empty() function considers empty OR your column LoginId does not exist (possibly because you are on a case-sensitive operating system and the capitalization in your table is not exactly LoginId.)
  24. Programming does not involve randomly changing your code in the hope it will work. You must know why you are changing something. You changed the - ajaxobject.open( ... ); statement so that it uses your ajaxtextarea variable, but you are setting the ajaxtextarea variable inside of a conditional statement that is only executed when the response is sent back from the web server. Your ajaxtextarea variable does not exist at the time you are using it in the ajaxobject.open( ... ); statement. The only thing you should have changed in the ajaxobject.open( ... ); statement was to use .innerHTML (and perhaps change the id being used to match what you randomly changed your <div> id to.)
  25. The formatting of the displayed email is handled in the cs_html_mail() function. Perhaps if you told us what overall script this is part of?
×
×
  • 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.