SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange file behavior when saving...

    I have a custom admin section where I can save, edit, and upload files all coded with php. However, I have a problem that occurs only on Javascript files that I have saved. It only happens on occasion and it can occur without even opening and editing the file. It's like it just mysteriously happens. Now the problem is every once in a while I will find a little 'x' appended to part of a javascript function
    Code:
    ×timeFunction
    which naturally causes the function to stop functioning properly. No pun intended.LOL.
    Anyways has anyone ever encountered anything like this? In my 8 years of programming I've never seen this happen. It's almost as if someone is hacking into the file and changing characters just to be malicious. However, viewing awstats shows that the file has not even been accessed. What could be going on here? Thanks in advance for any insight!

  2. #2
    SitePoint Wizard tgavin's Avatar
    Join Date
    Feb 2003
    Location
    FL
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not a javascripter, so the only thing that comes to my mind is that the file may contain garbage characters because of an encoding issue or corruption during the transfer or save.

    Have you asked in the js forum?

  3. #3
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I haven't asked in the js forum yet cause the past couple of days, I've been having images disappear from my hard drive as well. Could the hard drive be going bad and glitching files on its' own?

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Is it possible you're writing out the ASCII code for 215? Is 215 significant in some way?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  5. #5
    SitePoint Wizard tgavin's Avatar
    Join Date
    Feb 2003
    Location
    FL
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ilovemonster View Post
    No, I haven't asked in the js forum yet cause the past couple of days, I've been having images disappear from my hard drive as well. Could the hard drive be going bad and glitching files on its' own?
    I think you'd have bigger problems if it was a hard drive issue. I'd look into your scripts and see if there's a bug that's deleting those images, probably when some other action is being performed. Maybe you also have a bug that's writing those x's?

  6. #6
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I found out what was deleting the images, it was a defect in one of my scripts. I feel like a fool, but at least I found the prob with that. As far as some of the scripts getting altered, I installed and ran ClamAV and while it didn't find any virus, it did find over 200+ 'errors' no details provided. Every since I ran ClamAv no problems yet and it was happening pretty consistently. So I guess only time will tell. Thanks to everyone for your input! I've always found good advice on sitepoint!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •