Jump to content

Recommended Posts

i'm putting together an upload script that reads header information to verify, for example, if a file is actually a .odt (open office text document), but the header looks something like this...

 

chr(80).chr(75).chr(3).chr(4).chr(20).chr(0).chr(0).chr(0).chr(0).chr(0).chr(*).chr(*).chr(197).chr(54)........chr(116).chr(80)

 

the chr(*) represents some random character, which i don't really want to figure out how to find.

 

So is there any way to have a wildcard value which will allow it to be anything?

 

the check looks something like this...

 

$ext = the extension

 

 

if ($ext == '.odt'){
$filestr = fread($handle, 78); //78 is the length of the header i'm using
fclose($handle);
if ($filestr != chr(80).chr(75).chr(3).chr(4).chr(20).chr(0).chr(0).chr(0).chr(0).chr(0)."?"."?".chr(197).chr(54).chr(94)............chr(116).chr(80)){
deleteold2($number);
echo $filestr; //for debugging purposes
exit();
}

Link to comment
https://forums.phpfreaks.com/topic/54363-wildcard/
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.