SitePoint Sponsor

User Tag List

Results 1 to 15 of 15

Hybrid View

  1. #1
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php syntax question

    Can I take out all the carriage returns and spaces within my php pages to make it more "garbled" for others to try to edit and rip apart ?

    Will the pages all still function properly is done on a global scale to all my php files in a particular site ?

    I realize that there are proggies that make them very hard to edit - but - I just want it to be pretty hard to edit (i.e. no encryption).

    Any suggestions, software recommendation, or tips appreciated.

    Oznob

  2. #2
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't think of anywhere this would affect execution except for inside strings, so go for it.
    TuitionFree — a free library for the self-taught
    Anode Says...Blogging For Your Pleasure

  3. #3
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sure, you could do like a search/replace, and change all newline characters to spaces, that would pretty much do what you want.

    (although, if you are just talking about the PHP code, nobody can access that anyway, unless they have FTP access to your server)
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  4. #4
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They are going to have access to the FTP - and I know they will try to edit my code I just want to make it a pain in the *** for them if (when) they do

    Any tips on how (exactly) I can replace all the carriage returns with spaces ?

  5. #5
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Despending of the editor You use, I should be possible to just copy a carriage return and do a find and replace (replace with nothing). Alternetivly write '\r' in the find part.

    By the way, i don't know if there are PHP Editors, that can place carriage returns for better reading - like GoLive can rewrite a sourcecode and will put new carriage returns in the source...

    Flözen

  6. #6
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you copy a carriage return ?
    Does /r work for this in all cases - or - only if /r is seen in the code.

  7. #7
    SitePoint Zealot Ghandi's Avatar
    Join Date
    Sep 2002
    Location
    Kansas
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you couldn't restrict access to certain files?

    or keep copies of your code on hand to replace the edited files...

    just a few other options.

  8. #8
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its moreso a case of just making it hard on the guy (I wont go into details why).

    (still need answer to /r question above)

  9. #9
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    \r = mac newline
    \n = unix newline
    \r\n = windows newline
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  10. #10
    SitePoint Enthusiast
    Join Date
    May 2002
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What your trying to do won't really make anything more difficult. I could open a page formatted like that and just point my cursor in the middle of the file and start typing. That's enough to destroy any script!

  11. #11
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd look more at getting the FTP accounts setup to not allow them to change any of your files.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  12. #12
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont care if they wreck the scripts - the scripts were purchased by the guy and were supposed to stay on my servers. After a huge battle he wants the scripts on his server so I am going to comply just to shut him up --- I also know that he intends to reuse and sell these scripts which would take some of my other clients away from me.

    Although I am not proficient in php yet I do know that he is less proficient than I - so I want to make sure that he has a tough time changing them around (but at the same time - I cannot really encrypt them cuz that just would be taking it a bit too far).

    I have a utility called "HandyFile Find and Replace" which replace all instances of a string in multiple files.

    I have all my files on my windows computer.

    I want to replace "_______" with blank as I read above.

    So correct me if I am wrong if I replace:

    /r/n with "" (nothing)

    this should do the trick ?

  13. #13
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    backslash! \r\n on windows, in editplus you can go to find-replace, check 'Regular expressions', if your file is written with win (PC) line breaks, you can do replace \r\n with (nothing), if you develop on linux you replace \n with (nothing), in editplus for example you can see what format the file is, it says in the bottom right corner (PC/MAC/UNIX)
    - website

  14. #14
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hope you charged him enough to make up for the clients he wants to take from you.
    John

  15. #15
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like people are saying, the best policy is to adjust your business dealings so that this is a non-issue. Easier said than done, perhaps.

    Anyway, you could use this, I suppose: PHP Obfuscator/Obscurer ... not sure if that is too much for what you had in mind.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


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
  •