bobinindia Posted June 20, 2008 Share Posted June 20, 2008 So this is the code that writes to a text file: $fp = fopen('imagecode.php', 'w'); $vari = "<?php echo 'Image=".$theimage."'; ?>"; fwrite($fp, "$vari"); fclose($fp); Nothing too unusual there. Permissions are fine as it does write sometimes. $theimage is a file uploaded by a user. Testing on a mac I noticed that if an image in Finder has a preview icon it won't be written to this file. Any other image will. All jpgs. Any idea what that could be? Quote Link to comment Share on other sites More sharing options...
lemmin Posted June 20, 2008 Share Posted June 20, 2008 Are you sure it isn't getting written or is it just not displaying correctly? I don't know what Image="" is for, but if $theimage has a quote (") character in it, it will mess up the string. In any case, I'm pretty sure the issue is caused by something other than the code here. Quote Link to comment Share on other sites More sharing options...
bobinindia Posted June 20, 2008 Author Share Posted June 20, 2008 I have checked each time i uploaded the file the content of the imagecode.php. It only changed when the image had no image icon. The images are being uploaded and entered into the database as the images upload id is going up every time i run it regardless of the preview icon. This is an example of what is written in the file. <?php echo 'Image=images/uploaded/280.jpg'; ?> No unusual characters to break the string. Quote Link to comment Share on other sites More sharing options...
lemmin Posted June 20, 2008 Share Posted June 20, 2008 Is there any other code around the code that you have shown that could conditionally determine whether or not it is executed? Quote Link to comment Share on other sites More sharing options...
bobinindia Posted June 21, 2008 Author Share Posted June 21, 2008 Yes there was an if statement that wasn't noticed by me. Image size dependent. Thanks Lemmin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.