Jump to content

Antony the Awesome

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by Antony the Awesome

  1. I think that the ini_set() did it. Session has been whiped again.
  2. You might want to look at file_get_contents().
  3. [quote author=jesirose link=topic=123323.msg509601#msg509601 date=1169359963] It was the = instead of == :) [/quote] Yeah, I think that's what did it.  ;)
  4. Good night, and thanks a lot so far. I went ahead and tried the ini_set() and set the probability to 100 (100%). My long overdue session was gone when I visited the admin login. Maybe it did work? I'll check back in 24 minutes when my session should be expired again.
  5. I'll see what I can do. Thanks for the help. I'll post back here if I find a solution.
  6. Free server. I am not sure if they allow me to have my own php.ini. Now, could I use ini_set() to edit the gc  probability directive? I know ini_set only works during script execution, but it makes sense in my mind that it would work and I would only need the gc probability directive to be changed during execution.
  7. I saw it last night but kind of skipped over it. From PHP.net: [quote]session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor...[/quote] http://www.php.net/manual/en/ref.session.php#ini.session.gc-divisor
  8. http://script-dump.freehostia.com/phpinfo.php It's default with session.gc_probability set to 1 and the session.gc_divisor set to 100. That means there is a 1% chance? [quote]if($_SESSION['isLoggedIn'] = true) { = is setting it to true. use == to compare.[/quote] Thanks for pointing that out, I always make that mistake.
  9. Bear with me, I started session yesterday for the first time. My sessions never expire. The php.ini on my host looks like the default php.ini with the session.gc_maxlife directive the default 1440. My code is as follows below, I put in bold what I found to be the parts that need looking at. What's wrong? [font=Courier] __________________________________________________ <?php [b]session_start();[/b] $msg="Login successful."; [b]if($_SESSION['isLoggedIn'] = true) { header("Location: http://script-dump.freehostia.com/alna/redirect.php?msg=$msg"); }[/b] $dbServer = "mysql2.freehostia.com"; $dbUsername = "antmas10_rsp"; $dbPass = "thedog"; mysql_connect($dbServer, $dbUsername, $dbPass); mysql_select_db($dbUsername) or die("Failed to grab database."); if(isset($_POST['submit'])) { $username=$_POST['username']; $pass=md5($_POST['password']); $result=mysql_query("SELECT username FROM login WHERE username='$username' AND password='$pass'"); [b] if (mysql_num_rows($result) == 1) {   $_SESSION['isLoggedIn'] = true;   header("Location: http://script-dump.freehostia.com/redirect.php?msg=$msg"); }[/b] } ?> __________________________________________________ [/font]
  10. I still think that cookies may be my best solution. And I created a routine to grab the url with the GET variables, but that doesn't help with a form unless I would dynamically add hidden values which would be a pretty rigged way of doing things. Any other opinions?
  11. What confuses me is how would you append another variable to the url? I have ideas, but they seem unconventional.
  12. I have been developing an application for use in a game that shows the data in table form of the users of the other alliance. Non important. I have never ran into this problem before so I am curious how you would approach it. I have images as links above each column which links to .../index.php?orderby=column_name. This, obviously, uses the SQL ORDERBY to order whichever column. I also created a "highlight" feature which highlights rows between specified values (ie highlight rows between X strength and Y strength). This uses a form with the GET method. My problem occurs when you try to use both features. For instance, if you were to sort the strength column, it would simply go to the URL .../index.php?orderby=strength. If you were to then try to use the highlight strength option, it would also use the GET method, simply changing the url to .../index.php?strlow=X&strhigh=Y This erases the previous orderby variable in the url and would fall to my default orderby I have programmed in. So, I should be saving ALL of these variables as I set them? Cookies? Sessions? Appending variables to current URL? I have never encountered this problem before. What should I do?
×
×
  • 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.