Gå til innhold

Anbefalte innlegg

Videoannonse
Annonse

det er home.no.net jeg mener ja. Har brukt cgi før, men var ikke sikker på om SSI funket.

Jeg får fortsatt ikke til å vise telleren min ved hjel av SSI. kan det være koden?

 

<!--#include virtual="/bin/clockhit.cgi" -->

Endret av Tha_Zaynt
Lenke til kommentar

hei... ser ut som du ikkje har CHMOD riktig på filen... Får internal server-error når eg prøver å vise den, kan kan ikkje laste den ned..

Prøv først CHMOD 777 for å teste det. Så kan du bruke "mindre" verdiar etterkvart, for å sjå om det også funker. 775 eller 755 burde funke bra også...

Lenke til kommentar

dette er koden til til cgi-scriptet:

#!/usr/bin/perl


print "Content-type: text/html\n\n";

##################################################
######################## Define variables
##################################################

$programurl = "http://ukzone.hypermart.net/scripts/demos/cgi-bin"; ## Where this file is
$displayclock = 0; ## Change to 0 not to show clock
$displayday = 0; ## Change to 0 not to show day
$displaydate = 0; ## Change to 0 not to show date
$displayhits = 1; ## Change to 0 not to show hitcounter
$besneeky = 0; ## Change to 1 to be sneeky
$sneekyadd = 50; ## How many hit's to add per day if sneeky is on

## Optionals for Date
$datefont = "Comic Sans MS";
$datecolour = "#000000";
$predate = "The date today is :- ";
$datesize = "+1";

## Optionals for Time
$timefont = "Arial";
$timecolour = "#CCCCCC";
$pretime = "The time now is :- ";
$timesize = "+1";

## Optionals for Day
$dayfont = "Comic Sans MS";
$daycolour = "#000000";
$preday = "";
$daysize = "+1";

## Optionals for Hitcounter
$hitfont = "Arial"
$hitcolour = "#CCCCCC";
$prehit = "Number of hits : ";
$hitsize = "+1";


##################################################
######################## Other variables
##################################################

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ## Get date

if ($mon < 10) {
     $mon = "0$mon";
  }
if ($mday < 10) {
     $mday = "0$mday";
  }
$month = ($mon + 1);

$year = $year + 1900;

$date = "$month/$mday/$year"; ## Get date

chop($date) if ($date =~ /\n$/); ## clean up date

@months = ("January","February","March","April","May","June","July","August","September","October","November","December");

@days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

## Use $months[$mon] to get month name

## Make sure min is OK


if ($min<10) {
$min = 0 . $min;
}

## Display time

if ($displaydate) {
print "<center><FONT FACE=\"$datefont\" COLOR=\"$datecolour\" SIZE=$datesize>$predate $mday/$months[$mon]/$year</FONT></CENTER>\n";
}

if ($displayday) {
print "<center><FONT FACE=\"$dayfont\" COLOR=\"$daycolour\" SIZE=$daysize>$preday $days[$wday]</FONT></CENTER>\n";
}

if ($displayclock) {
print "<center><FONT FACE=\"$timefont\" COLOR=\"$timecolour\" SIZE=$timesize>$pretime $hour:$min</FONT></CENTER>\n";
}


## Open hits

if ($displayhits) {
open(INF,"hitcount.txt"); ## Open read file
@numhits = <INF>; ## Put into an array
close(INF); ## Close file
$numhits = join('',@numhits);
chomp($numhits);

## Add hit

$numhits++;

## Save hit's

open(OUTF,">hitcount.txt"); ##  Banner file for appending

print OUTF
"$numhits\n"; ## Write user fields

close(OUTF); ## Close file

## Display hits
print "<center><FONT FACE=\"$hitfont\" COLOR=\"$hitcolour\" SIZE=$hitsize>$prehit $numhits</FONT></CENTER>\n";

}

if ($besneeky) {
       &sneeky();
}


sub sneeky {

open (LASTTIME,"<sneeky.txt");
@lastday = <LASTTIME>;
close (LASTTIME);
$lastday = join('',@lastday);
chomp($lastday);
if ($date ne $lastday) {

## Save new date

open(OUTF,">sneeky.txt"); ##  Banner file for appending

print OUTF
"$date\n"; ## Write user fields

close(OUTF); ## Close file

## Open hit counter

open(INF,"hitcount.txt"); ## Open read file
@numhits = <INF>; ## Put into an array
close(INF); ## Close file
$numhits = join('',@numhits);
chomp($numhits);

## Add hits

$numhits = $numhits + $sneekyadd;

## Save new hits

open(OUTF,">hitcount.txt"); ## Banner file for appending

print OUTF
"$numhits\n"; ## Write user fields

close(OUTF); ## Close file

}

} ## End sub

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...