Αρχή :: Ενότητες :: internet :: Κώδικας     

Internet :: Κώδικας.

Σε αυτή τη σελίδα υπάρχουν ερωτήσεις ή απαντήσεις σε απορίες που είναι αναγκαίο η τοποθέτηση κώδικα html για καλύτερη εξυπηρέτηση του χρήστη

Πρώτη :: Προηγούμενη :: Επόμενη :: Τελευταία   Σελίδα 5 από 5

» Redirect (solved) Aπάντηση
Από: Faq Admin την 20/5/2001
Σχετικά με το redirect.
Το παρακάτω freame κλειδώνει το πραγματικό URL
<HTML>
<TITLE>doamin.gr</TITLE>
<META NAME="description" CONTENT="domain.gr">
<META NAME="keywords" CONTENT="">
<FRAMESET border=0 rows="100%,*" frameborder="no" marginleft=0 margintop=0 marginright=0 marginbottom=0>
<frame src="http://domain.gr/index.htm" scrolling=auto frameborder="no" border=0 noresize>
<frame topmargin="0" marginwidth=0 scrolling=no marginheight=0 frameborder="no" border=0 noresize>
</FRAMESET>
</HTML>
» 3 script σχετικά document.lastModified (solved) Aπάντηση
Από: Faq Admin την 16/5/2001
Και τα τρία σε σειρά
<SCRIPT LANGUAGE="Javascript">
<!--//
var date = new Date(document.lastModified);
document.write("Last Updated:"+(date.getMonth()+1)+ "/"
+ date.getDate()+ "/" + date.getFullYear() + "");
//-->
</SCRIPT>

==================

<script language="JavaScript"><!--
function getCorrectedYear(year) {
year = year - 0;
if (year < 70) return (2000 + year);
if (year < 1900) return (1900 + year);
return year;
}

var lmDate = new Date(document.lastModified);

if (document.all || document.layers)
year = lmDate.getFullYear();
else
year = getCorrectedYear(lmDate.getYear());
//--></script>



======================



<script
type="text/JavaScript"
language="JavaScript">
<!--
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getYear();

// handle different year values
// returned by IE and NS in
// the year 2000.
if(y >= 2000)
{
y -= 2000;
}
if(y >= 100)
{
y -= 100;
}

// could use splitString() here
// but the following method is
// more compatible
var mmm =
( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
(10==m)?'Oct':(11==m)?'Nov':'Dec';

return "" +
(d<10?"0"+d:d) + "-" +
mmm + "-" +
(y<10?"0"+y:y);
}


//
// get last modified date of the
// current document.
//
function date_lastmodified()
{
var lmd = document.lastModified;
var s = "Unknown";
var d1;

// check if we have a valid date
// before proceeding
if(0 != (d1=Date.parse(lmd)))
{
s = "" + date_ddmmmyy(new Date(d1));
}

return s;
}

//
// finally display the last modified date
// as DD-MMM-YY
//
document.write(
"This page was updated on " +
date_lastmodified() );

// -->
</script>

=====================
» links & ΠΑΡΑΘΥΡΑ ΜΕ ΔΕΔΟΜΕΝΟ ΠΛΑΤΟΣ - ΥΨΟΣ (solved) Aπάντηση
Από: Faq Admin την 16/5/2001
Απαντήθηκε από το χρήστη: tony την 24/3/2001
Παράδειγμα σελίδας
<script
language="JavaScript">


function popup() { window.open('http://domain.gr/image.gif','EANITHING','toolbar=no,location=no,
directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,
width=380,height=270');}
</script>

</HEAD>
<BODY>
<P>text eae text eae oi link <A href="javascript:popup()">test link</A></P>
</BODY>




<style type="text/css">
<!--
body { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000}
td { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000}
th { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000}
A:link {text-decoration: underline;}
A:visited {text-decoration: underline;}
A:hover {text-decoration: underline;}
-->
</style>
» 404 error cgi script (solved) edit message του rapid-eraiser
Από: Faq Admin την 16/5/2001
Ego pali 8a sou protiva av exeis access se cgi-bin me perl va trekseis to eksis script

#!/usr/bin/perl
$go_to = "/404.html";
$password = "JustPasS";

open (FILE,"$datafile");
@urls = <FILE>;
close(FILE);


if ($ENV{'QUERY_STRING'}) {
if ($ENV{'HTTP_REFERER'}) {
$i = 0;
for ($i = 0; $i <= $#urls; $i++) {
chomp($urls[$i]);
($num,$url) = split(/\|/, $urls[$i]);
if ($ENV{'HTTP_REFERER'} eq $url) {
$num++;
$urls[$i] = "$num|$url";
$found = 1;
}
}
unless ($found) { push(@urls,"1|$ENV{'HTTP_REFERER'}"); }
if ($#urls > 1) {
for($i = 0; $i < $#urls; $i++) {
for($j = 0; $j <= $i; $j++) {
($num1,$x) = split(/\|/,$urls[$j]);
($num2,$x) = split(/\|/,$urls[$j+1]);
if ($num1 < $num2) {
$temp = $urls[$j];
$urls[$j] = $urls[$j+1];
$urls[$j+1] = $temp;
}
}
}
}
open(FILE,">$datafile");
foreach $line(@urls) { print FILE "$line\n"; }
close(FILE);
}
print "Location: $go_to\n\n";
}
elsif ($ENV{"REQUEST_METHOD"} eq 'POST') {
print "Content-type: text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
if ($FORM{'password'} eq $password) {
open (FILE,">$datafile");
close(FILE);
print "<html><head><title>Deleted</title></head>\n";
print "<body>The data has been deleted</body></html>\n";
exit;
}
else {
print "<html><head><title>Bad Password</title></head><body>\n";
print "The password you entered is incorrect.</body></html>\n";
exit;
}
}
else {
print "Content-type: text/html\n\n";
print "<html><head><title>404 Report</title></head><body>\n";
print "<h1>404 Report</h1>\n";
print "<table cols=\"2\"><tr><td width=\"30\">Hits</td><td>Referring URL</td></tr>\n";
foreach $line(@urls) {
chomp($line);
($num,$url) = split(/\|/,$line);
print "<tr><td width=\"30\">$num</td><td><a href=\"$url\" ";
print "target=\"$url\">$url</a></td></tr>\n";
}
print "</table><h1>Delete Data</h1><form method=\"POST\">\n";
print "Password:<input type=\"password\" name=\"password\"><br>\n";
print "<input type=\"submit\" value=\"Delete\"></form></body></html>\n";
}


Sto idio folder bale kai eva html arxeio ( 404.html )pou va leei afto pou 8es opos epeisi kai eva 404.txt adio arxeio gia va krataei tis akures dief8ivseis.
Telos gia va to evergopoinseis sou xriazete va tropoinseis to .htaccess pou briskete sto root tou site sou grafovtas
ErrorDocument 404 /cgi-bin/404.cgi?404

afta ....

Ama koliseis me to cgi pes to dev eivai tipota to spoudeo sav script alla askizei va exeis tis akures url pou zitave katakerous

Πρόταση | Ερώτηση | Καταχώρηση site







Η Εταιρία | Web Hosting | Domain names | Web Information | Υπηρεσίες | Resellers | Υποστήριξη |
Copyright © 2007–09 4GR.NETWORKS, All rights reserved.