Any Interest?

Discussion in 'Web Design and Development' started by purplelizzard, Feb 25, 2007.

?

Would this be useful?

  1. Yes

    6.7%
  2. No

    93.3%
  1. purplelizzard macrumors newbie

    Joined:
    Feb 8, 2007
    #1
    Would anyone be interested in a site where you can test server-side code like PHP, Ruby or Perl? I have started making a site like this, but before I finish it, I want to see if there is any interest.
     
  2. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #2
    I don't think it would be secure for you. Anyone could run a script that could delete files from the server, send spam, etc.
     
  3. Nicolasdec macrumors 65816

    Nicolasdec

    Joined:
    Dec 7, 2006
    Location:
    São Paulo
    #3
    I agree with nightelf.
     
  4. fivetoadsloth macrumors 65816

    fivetoadsloth

    Joined:
    Aug 15, 2006
    #4
    Yes, There could be some potential problems and misusings.
     
  5. purplelizzard thread starter macrumors newbie

    Joined:
    Feb 8, 2007
    #5
    I already considered that. I would make it so when someone put in something that would potentially cause harm, the code wouldn't be run and they would be warned, if they did it again, they would be removed. I would also disable mail.

    Is there a way to make the script run as a user without permissions to modify files?

    Security aside, would this be useful
     
  6. rjrufo macrumors regular

    Joined:
    Sep 18, 2002
    Location:
    Boston
    #6
    Why would you want to provide something like that to the general public? I can't speak for anyone else, but I test my code on my own server before releasing it. Uploading it to someone else's is not only a waste of time, but could also open a can of worms that I wouldn't want to open.
     
  7. Knox Administrator

    Knox

    Staff Member

    Joined:
    Jul 1, 2002
    Location:
    UK
    #7
    It would be possible to stop specific functions such as file modification, but many PHP scripts use files so that wouldn't be desirable. Mail would be the same, people would need to test that.

    However, you would have to give each user an individual account and only allow them to perform actions within the confines of that account. This would basically turn the service into a shared hosting account and so I'm not sure what it would offer over a normal, cheap, hosting account.

    I think you would encounter all the problems that a hosting company would with spammers etc, but without an accounting trail it would be virtually impossible to trace the users and so provide no deterrent against malicious code.
     
  8. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
  9. purplelizzard thread starter macrumors newbie

    Joined:
    Feb 8, 2007
    #9
    Imagine that you just started out learning PHP or Ruby. You go online and see a really cool function, and want to test it out. (you don't have apache installed on your computer, because many windows users don't when they start out, obviously once you get better and more serious, you will install apache, but many beginners dont. Also, on a mac, PHP is disabled by default.) To test this function, you could upload it to your server and try it that way, or you could go to this website and type in the new code and easily change and test it until you get it correct. That way you don't have to upload your changes repeatedly.

    What I want to do is this:
    Have all of the website run with permission to modify files.
    Have the files created with the test code run as users without permission to modify files

    I will have a database or two that is open to everyone with phpMyAdmin installed.

    I will upload a test soon.
     
  10. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #10
    Remember to check out the Terms of Service of your hosting provider. Some companies do not allow third parties to run their code in the server.

    You could also have an app to preview/edit CSS. In one text area you write the CSS code, and in the other text area you write the HTML.
     
  11. stndn macrumors member

    Joined:
    Oct 22, 2006
    Location:
    earth
    #11
    Here's a code snippet for you to consider:

    PHP:
    <?php

    fn_hello_world 
    ();

    function 
    fn_hello_world ()
    {
       while (
    1)
       {
          return 
    fn_hello_world ();
       }
    }
    ?>
    Okay, one call to this script is not really going to bring your server down to its knees, as the connection will be cut when the script does segmentation fault (which I tried just now on our local server out of curiosity).

    But consider hundreds or thousands or however many billion calls to the script above at the same time, and you'll probably need to unplug your server to save it from burning.

    I can see your point of having novice learners who want to try out a code snippet they found on the web. But when they find the code I posted above and they make your webhost ban your account, is it going to be worth it?


    A better approach might be to create a forum (or a place) where people can discuss codes they found on the web, and maybe have a sub section where people can learn how to install their own server.

    It's going to give them a lot of work, sure. But that's how they can learn.
    Instead of giving you headache for what they want to learn (and probably use in the future), why not give them guidance instead? After all, the best way to learn is the hard way ....


    To answer your question: Is it useful? It really depends.

    For novice: Probably not much since they won't know what they are doing anyway. And if they find something doesn't work, how do they know if it's because of the mistake in their code or it's because of your PHP settings?

    For intermediate / advanced / etc: Most likely not, since most of the people in this group would have working environment they can use already.

    For people with bad intentions (spammers, etc): Most likely yes, since they can work their bad scripts without having to worry about providing their own server. You want to ban their email account? What's stopping them from signing up for a free email account and register on your site?

    For you: Not sure - what do you think?


    -stndn.
     
  12. Knox Administrator

    Knox

    Staff Member

    Joined:
    Jul 1, 2002
    Location:
    UK
    #12
    I'm still not really seeing any benefit to it to be honest. I can't envisage someone who is interested enough in a PHP function not having a method of testing it. Yes, they wouldn't have to upload the file each time they changed it, but they still would have to edit it on your system and/or upload it to your system, then make sure they took those changes and put it back into their copy correctly.

    What might be more useful for beginners (but harder to write for you) would be a code validator. With that, you wouldn't necessarily have to run the code itself but instead check it for errors - missing semi-colon, misspelt function name etc.
     
  13. purplelizzard thread starter macrumors newbie

    Joined:
    Feb 8, 2007
    #13
    I agree with the idea of writing a validator, are there any out there already? That would be more useful.
     

Share This Page