Jump to content


Photo

Session help


  • Please log in to reply
11 replies to this topic

#1 PakiGangsta

PakiGangsta
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 03 August 2006 - 08:40 AM

I am wondering on how to make it show like random letters and random numbers to show battle session
The one and only KingBowser :).

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 03 August 2006 - 08:45 AM

What do you mean? Generate a random string of letters and numbers? And how's that connected with sessions?
Think you're smarty?

(Gone until 20 to November)

#3 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 08:49 AM

you can use a function like this

<?php
session_start();

function random_session() { 
  $salt = "abchefghjkmnpqrstuvwxyz0123456789"; 
  srand((double)microtime()*1000000);  
      $i = 0; 
      while ($i <= 7) { 
            $num = rand() % 33; 
            $tmp = substr($salt, $num, 1); 
            $sess = $sess . $tmp; 
            $i++; 
      } 
      return $sess; 
}

$_SESSION['random'] = random_session();

?>

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#4 PakiGangsta

PakiGangsta
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 03 August 2006 - 09:21 AM

there but can anyone help me with this checking if the same session was the last session f5 stuff
The one and only KingBowser :).

#5 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 09:27 AM

You need to explain your questions better. I have no idea what that meant

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#6 PakiGangsta

PakiGangsta
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 03 August 2006 - 09:29 AM

like this
ok if my bid is 123 and i refresh it will be 123 but i cant seem to figure it out
The one and only KingBowser :).

#7 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 09:33 AM

if you use that function that I posted it should not be returning the same session at all

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#8 PakiGangsta

PakiGangsta
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 03 August 2006 - 09:35 AM

but this is what i used $sessionid=md5(uniqid(rand(1000000,9999999), true));
The one and only KingBowser :).

#9 PakiGangsta

PakiGangsta
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 03 August 2006 - 09:40 AM

Ok i used your method and even if you refresh it stays the same.
like this http://www.pkrpg.inf...n=pv6t56x5&old= after 10 refreshs
The one and only KingBowser :).

#10 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 09:56 AM

no it shouldn't check this one out refresh it as many times as you want http://www.owpt.biz/test/tes.php

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#11 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 09:57 AM

you are passing the session through the url. That is why it is not changeing

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#12 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 03 August 2006 - 10:00 AM

here is the code that i used for that url that I posted

<?php
session_start();

function random_session() { 
  $salt = "abchefghjkmnpqrstuvwxyz0123456789"; 
  srand((double)microtime()*1000000);  
      $i = 0; 
      while ($i <= 10) { 
            $num = rand() % 33; 
            $tmp = substr($salt, $num, 1); 
            $pass = $pass . $tmp; 
            $i++; 
      } 
      return $pass; 
}

$_SESSION['random'] = random_session();

echo 'The random session is <b>' .$_SESSION['random'] . '</b> and this test worked';

?>

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users