Jump to content

coding problem--need help


oracle259

Recommended Posts

I have the following code which should generate something like this

c8aad58bd948b0245a78c5b03ace6a333b94827eef5c865372f65e81e96346f4051314e7ce7854f5

instead it does this:

$token[$h].$token[$h].$token[$h].$token[$h].$token[$h].$token[$h].$token[$h].$token[$h].$token[$h].$hash[$h]

I know that the problem is with how i constructed $track and passed it to $sessid. But how do i fix it

[code]
$token=' ';
for ($f=1;$f<=100;$f++) {
$seedID = substr('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789~!@#$%^&*+?.', rand(1,73), 1);
$trackingID .= trim($seedID);
}
$token = sha1(uniqid(trim($trackingID)));

for ($g=1;$g<=10;$g++) {
srand((double)microtime()*1000000);
$seq .= rand(1,2);
}
    $toke = "$"."token["."$"."h].";
      $hashen = "$"."hash["."$"."h].";
                               
    $track = eregi_replace("1", "$toke", "$seq");
      $track = eregi_replace("2", "$hashen", "$track");
      $string = strlen($track) - 1;
        $track = substr($track, 0, $string);

$sessid = '';
for($h=0;$h<strlen($token);$h++) {
          $sessid = $track;
         
}



 
echo $sessid;

[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.