Question regarding fopen



Hi, I'm having a strange problem with fopen

For clearence, here is the phpinfo page:
http://www.grondengoed.nl/phpinfo.php

I will shortly explain the problem I'm having:
$imagenamesmall = $foldersystem . '/' . $id . $imgstr . '-s' .
$i . '.jpg';
echo $imagenamesmall; // For debugging purposses --> returns
exactly what I want.

//attempt to create folder
@mkdir($foldersystem);
@chmod($foldersystem, 0777);


//save picture
if(!($handle = fopen($imagenamesmall, 'w'))){
echo "Cannot open file (31)";
exit;
}

//$imagesmall, contains the image resource

if(fwrite($handle, $imagesmall) === FALSE) {
echo "Cannot write to file (32)";
exit;
}

fclose($handle);

Erverything works perfectly fine.But one thing, it doesn't give the
file the name that it should get. A name for instance has to be:
54961tdtdtdtd-s0.jpg
The number is the id of the database row, the 8 characters are random.
-s stands for small and 0 is the picture index.
When I echo the value, I get what I want. But when I save it, the
random 8 character string had become a totally different 8 character
string :S.

I have googled and checked things over and over again, cost me hours
and I still haven't found the reason. What is noticeable is that when
I leave one character away from the name, the value IS what it schould
be:S.

I really hope you can help me, if you need further info yust ask.

Thanks in advance.

regards,

Joep Roebroek
.



Relevant Pages

  • Re: TR - Day 2 of 8
    ... I have fairly straight blonde hair. ... into a Character Dining Restaurant. ... they take your picture against a wall with some African ... trail of those little Mickey Waffles for them to follow back to our table.. ...
    (rec.arts.disney.parks)
  • Re: [opensuse] Way Way Way OT
    ... My children bought me one of those digital picture frames this past Christmas. ... If you have edited any of your photos, even 1, you have changed the compression of that photo to a progressive .JPG & the frame will only display Standard .JPG's. ... You can just run the script with no arguments and it will give you basic usage information: ... echo -e "\t$cvt-resize $expands on the ImageMagick convert command by" ...
    (SuSE)
  • Re: "Dollhouse" = Duh-house
    ... He ripped through the Dollhouse, sparing Echo ... emergence of Echo as a character. ... original personality doesn't make it so. ...
    (rec.arts.tv)
  • Re: Standards question on edited fields
    ... as a "simple insertion character". ... impossible for the compiler to distinguish a syntactically-correct PICTURE ... Unisys now actively discourages the use of this convention. ... character except the blank could be used as a simple insertion character by ...
    (comp.lang.cobol)
  • Re: TR - Day 2 of 8
    ... We didn't have all the hobby horse races and ketchup deliveries, but our server stayed in character and did a great job. ... It was just enough "shtick" to enjoy without all the kids running around. ... asks me to get my camera out so I can get her picture with each character. ... I know that with the changes to the dining plan from including the tip to not including it, there might be some confusion, but to actually point out the absence of a tip is just plain rude. ...
    (rec.arts.disney.parks)