PHP error that I can't get working!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
esmarts
Forum Newbie
Posts: 14
Joined: Fri Aug 08, 2008 10:05 pm

PHP error that I can't get working!

Post by esmarts »

OK I am getting the following error:

Notice: Uninitialized string offset: 16 in C:\wamp\www\decode\upload.php on line 144

I think it has something to do with my coding being outdated, but I still cant get it.

Here is the lines where the error is occurring:

Code: Select all

 
141- // decrypt chunk
142- $j = 0 ;
143- for ( $i = 0 ; $i < strlen ( $chunk ); $i ++) {
                    //This is where the error is!
144- $chunk [ $i ]= chr ( ord ( $chunk [ $i ]) ^ mt_rand ( 0 , 0xff ) ^ ord ( $chunk_md5 [ $j ]));
145- if ( $j < strlen ( $chunk_md5 )) {
146- $j ++;
147- }
else {
 
$j = 0 ;
}
}
 
echo "Dumping decrypted header: <b>header.dat</b><br>\n" ;
$f = fopen ( "header.dat" , "wb" );
fwrite ( $f , $chunk );
fclose ( $f );
?>
Is there any other way of writing this?
Last edited by Benjamin on Tue May 05, 2009 7:30 pm, edited 1 time in total.
Reason: Changed code type to php.
esmarts
Forum Newbie
Posts: 14
Joined: Fri Aug 08, 2008 10:05 pm

Re: PHP error that I can't get working!

Post by esmarts »

LOL stupid me I have ^ in there!!!!


But for some reason I still can't get it to work? any suggestions
Post Reply