PDA

View Full Version : can some1



Weapon
December 6th, 2001, 23:40
covert this script to php for meh please?

#!/usr/bin/perl

@okaysites = ("http://www.myacen.net/otashki", "http://myacen.net/otashki");

$reffer = $ENV{'HTTP_REFERER'};

$headfile = '/home/myacen2/public_html/otashki/header.txt';

$footfile = '/home/myacen2/public_html/otashki/footer.txt';

$File = $ENV{'QUERY_STRING'};


unless (open (DATA,"$headfile")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@headinfo = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
foreach $headline (@headinfo){
$heading = $heading.$headline;
}

unless (open (DATA,"$footfile")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@footinfo = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
foreach $footline (@footinfo){
$footer = $footer.$footline;
}


foreach $domain (@okaysites) {
if ($reffer =~ /$domain/) {

print "Content-type:text/html\n\n";
print "$heading";
print "<CENTER><IMG SRC=\"$File\"></CENTER>";
print "$footer";
exit;
}
}
sub error {
print "Content-type:text/html\n\n";
print "Error!";
exit;
}

Weapon
December 7th, 2001, 03:02
:( :(

Gonzo
December 7th, 2001, 12:14
Why not just download a PHP script that does the same thing?

Weapon
December 7th, 2001, 17:33
well i have searched for them but all i can find a "gallery" scripts:(

Gonzo
December 7th, 2001, 18:16
What is it that, that script does?

niv
December 7th, 2001, 18:47
What Weapon failed miserably to tell you is that it doesn't show the images to people that didn't view the page off his main page.

What's wrong with the way it is? :confused:

Weapon
December 7th, 2001, 19:36
huh? all i want is an ordinary script that takes a header and footer .txt file and put them together so that u don't have to create an .html file for every image. And i just want that in php coz i can't find a decent cgi host thats all:angry2:

Cheap Bastard
December 7th, 2001, 21:31
hmm... if you know just a little of PHP, you could try to put together an anti-leech script (or something like it) and a gallery script.

Know it doesn't help much but it's an idea...

Weapon
December 7th, 2001, 21:38
good idea:D , too bad i have no knowledge of php programming what so ever:rolleyes: