#!/usr/bin/perl # Display usage help. sub Usage { system('clear'); print <\$_POST[variable] (The original will be saved as inputPhpFile.orig) So you can change php.ini register_globals from "On" to "Off". (Sometimes it's better not to delete f2 and f3 files (at the last line of this script) - if the FORM and its evaluation is not in the same php script.) Szabó, Zoltán - 2003 This little script is under GPL :) eof exit; } # Check command line args Usage if (scalar(@ARGV) == 0); $opt = shift (@ARGV); Usage if $opt eq "-H" or $opt eq "-h" or $opt eq "--help"; ##################### kezdő paraméterek beolvasása $be = $opt; $0 =~ s/[\.\/\\]*(\S+)/$1/; die "\n\nDurva lenne legyalulni a $0-t! :)\nYou shouldn't eliminate this nice $0 script!\n\n" if $be eq $0; # csak mert egyszer megtettem már... Once I deleted the program file itself... die "\nKeress más nevet, mint f2 - Try to find out some other filename than f2\n\n" if $be eq 'f2'; die "\nKeress más nevet, mint f3 - Try to find out some other filename than f3\n\n" if $be eq 'f3'; ############################################################################################### system("cp $be $be.orig"); open(F, $be); open(G, '>f2'); while( ) { $a=s/.*(name= *([\'\"]?)(.*?)([\'\"]?))[ \[\),].*/perl -pi -w -e \'s\/\$$3(?=\\W)\/\$_POST[$3]\/g\' $be/ig; s/\[/\\[/g; s/\]/\\]/g; s/\$/\\\$/g; print G if $a; } close(F); # ? : 0 or 1, man perlre # (?= ) : man perlre - look-ahead # system('sort f2|uniq>f3'); system ('chmod 755 f3'); system('./f3'); system ('rm f2');system ('rm f3');