Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Where is line 98? The error Cannot access empty property usually means PHP is trying to use a property from an object which doesn't exist.
  2. Your code doesn't use any system commands (mysqldump, mysqladmin etc) , it just queries the database to return the current tables and their table structure. From which it'll populate a .sql file for your database backup. Which in turn emails the backup.
  3. Not necessarily you can do $result['COUNT(*)'] Howwer a better option would be give the count a name in your query, eg And use $result['stats_count'] instead.
  4. When using SQLite in PHP make sure the library versions match between sqlite manager and PHP. The Sqlite library built-in to PHP is version 2.8.x (veryfy this by running phpinfo and looking for the SQLite subsection). If sqlite manager is using a newer version of the library, then PHP wont be able to read the database file correctly
  5. How did you create the table? Make sure your have spelt product correctly.
  6. Use file_put_contents to create and populate the .conf file, what you're trying to achieve is the same thing as displaying the data to the webpage (using echo or print) except your writing data to a file.
  7. Its because you're using short tags, on your host (quanticlab.com) short_open_tag is disabled, that is why you see your PHP in the source code. When modifying the php.ini make sure its the same php.ini PHP is using, you can check this by running phpinfo You might want to ask your host how to enabled short_open_tag and/or how to configure PHP. You'll be better of converting all short tags (<? ?>, <?= ?>) to full PHP tags (<?php ?>, <?php echo ?>). If the script still doesn work after converting the tags then your Server may be mis-configured.
  8. When debugging you should turn display_errors on and set error_reporting to E_ALL I have ran your code and setup a test database on my dev machine, and your the code works fine.
  9. On Index.php you have this: if(LOGGED_IN) { "You are logged in"; } it should be if(LOGGED_IN) { echo "You are logged in"; }
  10. If you don't to perform a loop, then remove the do while. What are you trying to achieve with the above code
  11. You code will always timeout if $e is not equal to 1, as $i is not being incremented I cannot see the purpose of the do .. while loop
  12. Change your confirmUser function to // Check Credentials function confirmUser($username, $password) { // undo magic cuotes if (get_magic_quotes_gpc()) { $username = stripslashes($username); } // escape harmful characters $username = mysql_real_escape_string($username); // md5 'n salt the password $password = md5($password . SALT); // check the username AND password in the query at the same time $sql = "SELECT username FROM " . USERS_TABLE . " WHERE username = '$username' AND password = '$password'"; $query = mysql_query($sql) or die("MySQL Error " . mysql_errno() . " with description " . mysql_error()); // check that mysql returned 1 result, meaning a match was found if (mysql_num_rows($query) == 1) { return TRUE; } // no match return false! return FALSE; }
  13. Cookies are stored as plain text on the client side. Cookies will only work on the site that created it. Cookies cannot be shared across multiple sites.
  14. Can you tell use where (or how) is the $getthreads3['reportreason'] variable defined?
  15. All values in a query must be wrapped in quotes $sql = "SELECT password FROM " . USERS_TABLE . " WHERE username = '$username'"; Also on your index page, session_start must be called before any output is made: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php include ("include/login.php"); session_start(); ?> Should be <?php include ("include/login.php"); session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16. Because you added the Zend folder to the include path, PHP is trying to include G:\PortableApps\WOS\Zend\Zend\Loader.php Zend comes in a Library folder (which contains the Zend folder). You should add the library folder to the include_path instead, that way PHP requests the file: G:\PortableApps\WOS\Libray\Zend\Loader.php
  17. Yes that is fine, however you don't need to pass the connection to mysql_real_escape_string. This is only required when you are using more than one database connection at a time.
  18. Do: $sep = ( isset($_GET) && (count($_GET) > 1) ) ? '&' : '?'; echo '<a href="' . $_SERVER['PHP_SELF'] . $sep . 'pid=' . $row['pid'] . '">Item Link</a>';
  19. Chnage your load function to function load($level) { $levels = array('level 1', 'level 2', 'level 3'); $level_key = array_shift(array_keys($levels, $level)); foreach ($levels as $level) { if($i <= $level_key) { _load($level); } } }
  20. PHP does not have a built in function for your needs, you'll need to create one. Have a look at the following comment over at php.net for such a function.
  21. I have not used Zend Framwork, however shouldn't all images, stylesheets etc be placed within the public folder, not the views folder.
  22. That will only be possible if the original developers created the site with PHPEclipse, and left the .project file The database will be stored in a different place, separate from your site files. In order to get the database you'll need to perform a database backup. Ask your host how to do this, or see if they'll do it for you. Before doing any thing make sure you have a good understanding of the basics of PHP, and how PHP works with databases, such as MySQL. You'll want to learn up on the basics of MySQL too.
  23. I see you use "rn" in your code above, I presume you want a new line in which case you should use "\n" (or "\r\n") for newlines.
  24. Qcodo is a PHP Framework, offical site here. You can edit PHP files in any text editor, you do not need to use a specific IDE. I've not used eclipse much, however you should be able to create a new project and there should be an option for telling Eclipse where your file are located. Eclipse will then import your site for you.
  25. mysql_real_escape_string can be called anywhere in your script provided there is a valid mysql connection established. You do not need to call it specifically in a query.
×
×
  • 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.