<?php
/*************** PHPLinkRot v 1.0 ***************/
/************************************************/
/* written by A. Gianotto - 3/28/2000 */
/* To find out if this is the latest version */
/* of this script, email hide@address.com, or */
/* visit http://www.snipe.net */
/************************************************/
/* You can see this script in use by going to */
/* http://www.snipe.net/blarginflarn.html */
/* (That page doesn't exist, so you will come */
/* to a custom 404 page which then uses this */
/* program.) */
/************************************************/
/************************************************/
/* PHPLinkRot may be used freely for private */
/* or commercial use. All I ask is that you */
/* don't include it in any collections without */
/* my permission. */
/************************************************/
/************************************************/
/* DESCRIPTION: */
/* This program can be used in */
/* conjunction with a custom 404 page. */
/* */
/* It simply gets the referring URL and prints */
/* a form that allows the user to quickly send */
/* the site administrator notification of the */
/* broken link. It also allows the user to */
/* send their name and email address with the */
/* notification, as well as a short comment, */
/* to allow the site administrator to send the */
/* user the correct URL if they choose to. */
/************************************************/
/************************************************/
/* INSTALLATION: */
/* There is no readme or install file with */
/* script, because it's so easy to install, */
/* you just have to follow the comments in the */
/* first part of the code */
/************************************************/
/************************************************/
// make this point to your header file. rename the file
// and the path to point to the correct file on your server
// If you do not use a header or footer file, simply replace
// the header and footer includes with the proper HTML code
// for your site
include("header.inc");
// Enter the website administrators email address here
$adminaddress = "hide@address.com";
// Enter the company name or site name here
$sitename = "Faculta de Ingeniería";
// Enter the address of your website here
$siteaddress ="index.php";
// Unless you are changing the verbage of the printed message,
// there are no further configurations that need to be done
// past this point, except editing the path to your footer includes
// If you do not use header and footer files, you can just replace
// the include calls with your HTML, but be sure to close the PHP tags
// before and after the HTML, so you don't get parse errors.
IF ($action==""):
?>
<H3>Help Us fight linkrot!!</H3>
<?
$referer = getenv("HTTP_REFERER");
print "<B>$referer</B><BR><BR>";
?>
Puede reportar este enlace roto y ayudarnos a mejorar el sitio, para eso solamente debe llenar un simple formulario debajo.
<BR>
<BR><B>Nota:</B> Solo requerimos su nombre y dirección de e-mail así podremos notificarle si la página que estaba buscando fue movida. <BR><FORM METHOD=POST ACTION="<? echo "$PHP_SELF"; ?>">
<TABLE BORDER="0" CELLSPACING="3" CELLPADDING="3">
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Name:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="name"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif" SIZE="-
1">Email:</FONT></TD>
<TD VALIGN="TOP"><FONT FACE="Arial, Helvetica, Verdana, Sans Serif"
SIZE="3"><INPUT TYPE="text" NAME="email"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="-1">Additional Comments:</FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="3"><TEXTAREA NAME="comments" ROWS="3"
COLS="30"></TEXTAREA></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP" COLSPAN="2"><FONT FACE="Arial, Helvetica, Verdana, Sans
Serif" SIZE="3"><INPUT TYPE="hidden" NAME="url" VALUE="<? echo "$referer"; ?>"><INPUT
TYPE="submit" NAME="action" VALUE="Send"></FONT></TD>
</TR>
</TABLE>
</FORM>
<BR>
<BR>
<BR>
<BR>
<BR>
<? include("footer.php");
exit;
ELSEIF ($action="Send"):
mail("$adminaddress","Enlace roto en $sitename","$name ha reportado la siguiente URL rota:
$url
Additional Comments:
------------------------------------
$comments
------------------------------------
$sitename
$adminaddress
$siteaddress","FROM:$email");
?>
<H3>Gracias!</H3>
Apreciamos que se haya tomado el tiempo para mejorar nuestro sitio, si la página que está buscando aun existe en nuestro servidor, pero ha sido movida, le enviaremos un e-mail con la nueva ubicación.
<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR>
<?
ENDIF;
include("/usr/home/your-site.com/html/inc/footer.inc");
?>