Jump to content

guitarist809

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Everything posted by guitarist809

  1. lol, bump is a statment that means "My topic is falling in the list of other topics, i wanna make it first again" bump also like "Bump, its at the top now "
  2. I'm just trying to do something similar to what PhpBB does (with theyre "Keep me logged in forever" option). And this site isn't public, its for my family and i know that we all accept cookies on our pc's (so that's not much of an issue)
  3. JavaScript Cookies ?? But I would Suggest You Dont Use Cookies Use Sessions Its Much more Simple and also more secure. I did use sessions, but they would self-terminate when I closed out of my browser. With cookies you can set a delete time. /* set the cache expire to 30 minutes */ session_cache_expire(30); $cache_expire = session_cache_expire(); you can change the max lifetime for a session with the function ini_set(). <?php ini_set("session.gc_maxlifetime", "18000"); ?> That code did'nt do anything As soon as I exit my browser and start it up again i still have to re-authenticate
  4. Still does nothing. I think that setcookie() isnt doing anything becides returning true...
  5. JavaScript Cookies ?? But I would Suggest You Dont Use Cookies Use Sessions Its Much more Simple and also more secure. I did use sessions, but they would self-terminate when I closed out of my browser. With cookies you can set a delete time.
  6. Basically it goes as follows: login.php => input username/password into a form. Submit form login.php => Make sure username/password is valid w/ mysql database. if it is, set two cookies (username and password) and do header('location: main.php'); main.php => check cookies ($_COOKIE['username'], $_COOKIE['password']) - make sure those are set. (They wern't so I did a print_r to see what was in $_COOKIE, but nothing was there... main.php => if no cookies are set (or cookies contain invalid information)... header('location: login.php'); Hope that helps with my prob...
  7. Yea I saw that. I refreshed the page w/o the setcookie function and still didn't see the cookies =\. Just the PHPSESSID...
  8. Hello, I'm trying to set two cookies on my site, containing a username and password so I can retrieve them for later use This function doesn't set any cookies i give it function session_init($username, $password) { setcookie("tripdb_username", $rs['username'], time()+3600); setcookie("tripdb_password", $rs['password'], time()+3600); echo "cookies set!"; echo "<pre>"; print_r($_COOKIE); I'm using the print_r to show all cookies, all it shows is a PHPSESSID Why isn't this working?
  9. Wow! I guess your "Super Guru" title is correct. Thx for the help ^^ [solved]
  10. Hello, I've got about 45 php files in about 4 different directories. The way I've always counted the lines of code I've written is by opening every file up and going to the very last line and adding it to a sum of all the other files. Is there a way to calculate this in PHP (like go into every directory, upload every file, and count the lines that way)? I don't want to use a program that's already made (im trying to display the lines of code on a statistics page on my site) Any help will be greatly appreciated, Thanks, Matt N
  11. well yea, i was doing pseuidocode basically I'm trying to update every row's comments with replacing all <br>'s with \n's
  12. Hello everybody. I'm trying to do a "mass update" in a table of mine the structures is as follows id, name_id, location_id, comments. Before, i used to have to manually enter <BR> for a newline (in the comments), but i just found about nl2br(). Is there a query i can do to update all the text in the comments field (for every row) to replace any <br>'s with \n's? UPDATE table SET comments=REPLACE('<br>', '\n') WHERE 1 Thats what I'm trying to do... Any help would be greatly appreciated, Thanks, -Matt
  13. Hello, Is there a way to do a query like this? SELECT `field1`,`field2`,`field3` FROM `mytable` WHERE `field1` = 1 OR WHERE `field1` = 2 OR WHERE `field1` = 8 If you didn't get what I was trying to do I'm trying to select some rows where "field1" can either be 1, 2, or 8. How can I do this? Thanks, -Matt
  14. Yep, it was table status. Thx for the help
  15. Sorry, I was kinda in a rush when I was writing that. What I'm doing is writing a database statistics page (similar to phpbb's, if you've ever seen it; it's the admin index). It shows the size of the database in megabytes (all tables combined). For example, dbname is 5mb. For the second question, I'm trying to get a total of the amount of records in a database. For example, my database db1 has 5 tables in it. Lets say all the five tables have 5 records in them. I'm trying to get the total of records, so thats all the tables combined, which is 25 in total. I found a cheap way to do it (do a select * from tablename and do mysql_num_rows($result) and just add those for every table, but that's a pain. Is there an easier way of doing that (like mysql_sum_total_records($dbname)))? Thanks, Matt
  16. Hello, I've new to php's side of mysql and I was wondering if maby somebody could help me The first problem I encountered is how big my database is (in kilobyes or megabytes). I have no idea how to start this one so any help would be useful. My second problem is how many records are in the database and in each table in the database (I don't want to run 20 mysql queries and do a num_rows on them and add them for the entire database. or is this the only way to do it ???) Any help would be greatly appreciated. Sincerely, -Matt
  17. Not Necessairly. Take this example of a table [date] [value] [2007-1-1] [valueasdf] [2007-1-1] [valuasdfe] [2007-1-2] [valuade] [2007-1-3] [vafalue] [2007-1-3] [vadfalue] [2007-1-3] [valdfue] [2007-1-4] [valsdfaue] [2007-1-4] [valdsue] [2007-1-5] [valfdue] [2007-1-8] [valsfue] I just want MySQL to return this [2007-1-1] [valueasdf] [2007-1-2] [valuade] [2007-1-3] [vafalue] [2007-1-4] [valsdfaue] [2007-1-5] [valfdue] [2007-1-8] [valsfue] Notice how none of the dates are the same. I dont care what it returns, just as long as there are no equal dates. The reason I dont care is because i'm not taking the value, its just counting each day.
  18. It really doesnt matter. I'm just trying to increment a variable by one if there is an event in one day. It's now incrementing by 3 in one day if theres three activities in one day, which makes everything wrong =\.
  19. Hello. I've got a little problem that I think is easy to resolve. I'm grabbing a bunch of entries from a table with a date field (YYYY-MM-DD), but I only want one field per day for example, I might have a few entries for 2005-03-25, but I only want the first of that. I was looking at those JOIN things, but I couldn't figure them out. Can anybody help me? Thanks, -Matt
  20. Well, I just found out that session_start() gives a ton of errors in a phpbb forum. Is there another way besides using cookies or sessions?
×
×
  • 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.