C Compiler

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

C Compiler

Post by S_henry »

Hello guys..If can, I want to make an interactive system (website). The user can type (input) the code (for example C language) into the provided area and when click 'Run' button, the system will output the result. Seem like need a compiler. But I absolutely have no idea how to do that. Anybody can help me pls..??
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

You really don't want to do that. I wonder how many viruses would be dumped on the system per minute...
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post by devork »

are you setting up honey pots. :)
your server will be down.
why you want to do this?
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

I think that is the way to make my system better because more flexible and dynamic. User can type their code and can just run through my system. So if there got any alternative or solution of this problem? And I also not very clear how viruses would be dumped on the system. Can anybody explain to me pls..
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Just think about what happens if someone submits some code that keeps forking itself... Plenty of other things are possible too. system("rm -rf /") is a nice one too...
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

Ok. I got it. That's absolutely right. But I don't know 'system("rm -rf /")'. Actually system("rm -rf /") is what?
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

S_henry wrote:Ok. I got it. That's absolutely right. But I don't know 'system("rm -rf /")'. Actually system("rm -rf /") is what?
.... 8O

You really have no idear what "rm" is?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

redhair wrote:You really have no idear what "rm" is?
It's more helpful if you explain. That's what we're here for.

[php_man]system()[/php_man] sends commands to the server.

If you've got shell access (can connect with telnet/SSH), track down an internet tutorial and try out some shell commands (with care!).
Last edited by McGruff on Tue Aug 09, 2005 2:23 pm, edited 1 time in total.
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

Actually I'm quite new in this field. So thanx a lot for your info. Ok, I'll try it.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Sorry, my last post was a bit ambiguous - didn't mean to criticise you S_henry.
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

No, it's ok McGruff, your reply is very good for me. It's a good explanation. I'll try to study about that first. Thanx.[/pg_man][/mysql_man]
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

McGruff wrote:It's more helpful if you explain. That's what we're here for.
Sorry Gruff, I just wanted to be sure before I go explain what a simple command is/ does.

Typing "rm --help" in your shell results in this:

Code: Select all

їredhair@hal9000 redhair]$ rm --help
Usage: rm їOPTION]... FILE...
Remove (unlink) the FILE(s).

  -d, --directory       unlink FILE, even if it is a non-empty directory
                          (super-user only)
  -f, --force           ignore nonexistent files, never prompt
  -i, --interactive     prompt before any removal
  -r, -R, --recursive   remove the contents of directories recursively
  -v, --verbose         explain what is being done
      --help     display this help and exit
      --version  output version information and exit

To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
  rm -- -foo

  rm ./-foo

Note that if you use rm to remove a file, it is usually possible to recover
the contents of that file.  If you want more assurance that the contents are
truly unrecoverable, consider using shred.

Report bugs to <bug-coreutils@gnu.org>.
There you go.

It's the UNIX equivalent of DOS' "DEL".

Pointless to say to be VERY carefull with this command.
Post Reply