Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. If you're using Firefox, someone has also posted comments about deleting cookies for it. The above example does not look like it will work for deleting a cookie for IE7...it looks like it just extends it, or deletes the value for it. Also, make sure you're using the full domain and all of the parameters. If you set it for domain.com, then delete it for www.domain.com and then you're on domain.com again, the cookie will show. It might not even be the cookie, it might be your code. We'd need to SEE the code to tell.
  2. use die(mysql_error()); instead of your "username does not exist" message, as was suggested a few times now.
  3. from the manual: If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix O, List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script. I wouldn't ever include files using a URL. You can use the $_SERVER variables to get the path.
  4. http://us3.php.net/manual/en/language.operators.logical.php
  5. I always want my code to be exciting, who wants uniform, easy to read code? If you really want to break up the dull, try using ASP style tags every now and then, or random indentation!
  6. Ken, he wants to know how many pages he'll need. Look. Do one statement to get the number of rows you would have. Which according to your EXISTING code, is every row in the table. You're not selecting any specific ones, you're selecting all of them. "SELECT COUNT(CompanyID) AS total_entries FROM company"; total_entries will be how many entries are in the table. Then divide it by however many you want per page and you've got your number of pages. Then select the rows you want. There are also a billion pagination tutorials out there for you to read, some of them on phpfreaks.com already.
  7. "I am using count already, only its getting the entire table size, and not my sql query size." What? What are you trying to get? The number of rows in the table, yes? If you want the number of rows in a specific query, do it. SELECT COUNT(*) AS numrows FROM company WHERE whatever else you want
  8. A blank page with no errors could mean you don't have error reporting turned on. Add this to the top of your pages: ini_set('display_errors', 1); error_reporting(E_ALL);
  9. Did you lookup COUNT to see what it was before saying it won't work?
  10. I didn't quite read all of the above posts, sorry. But for a "family tree" type database I'd do this as a basic design: Person Table ID Name Birthdate, ETC. Relationships Table Person1ID Relationship (EG, how is person1 related to person2: father, mother, sibling). Any other relationships can really be derived from the other relationships given. Person A's mother's brother is their uncle. Person2ID
  11. You'll have to do two select statements, yes. One to get the number: Use COUNT() And then one to get the 50 rows you want.
  12. If you don't know how many columns are in your table, you have not designed your database well.
  13. I don't see a problem with it...what do you mean it is the default everytime? The site looks .. fine.
  14. You need to use Javascript (and/or AJAX) to do that.
  15. It looks fine - do you have a link to the page live, maybe that will help?
  16. look up add_slashes and strip_slashes. Quotation marks denote strings, so you need to escape them.
  17. I'd have to see the new CSS file. Post it within code tags!
  18. Yes, but it's ONE constant, as opposed to on every page. It will take two seconds to change.
  19. Hey, at least you were already encrypting them! Good job
  20. http://us.php.net/setcookie Look at: Example 1588. setcookie() delete example http://us.php.net/manual/en/features.cookies.php
  21. You need more than one session variable. $_SESSION['from'] and $_SESSION['name']; It's an array.
  22. So when you need to print "January" you use $months[$month]; When you want 1, you use $month;
  23. Making a switch statement is a lot more code than an array
  24. Are your passwords encrypted in the database? You shouldn't store plain passwords. Change this code: $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); To $sql = "SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"; $result = mysql_query($sql) OR DIE(mysql_error().' - '.$sql); $login_check = mysql_num_rows($result); print 'Rows: '.$login_check; code]
×
×
  • 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.