# 404.php, 8/10/2000.
# Traps 404 errors and mails a notice to the webmaster.
# Requires PHP 3.0 or newer, and mail capability on your system.
#
# Copyright 2000 shaun@shat.net under the GNU Public License.
# Disclaimer: I wrote this script for me, and it works for me.
# If it doesnt work for you, or makes your server explode,
# thats life. Please email with questions or bug reports.
# Set these variables to configure the script:
# Set $domain to your domain name (no www)
$domain = "your.domain.com";
# Set $docroot to the URL of the directory which contains your
# .htaccess file. Dont include trailing slash.
$docroot = "http://your.domain.com";
# Font face youd like to use on the 404 page
$fontface = "Verdana";
# Font size youd like to use on the 404 page
$fontsize = "2";
# Background color of the 404 page (default is white)
$bgcolor = "#ffffff";
# Text color youd like to use on the 404 page (default is black)
$textcolor = "#000000";
# This script is capable of mailing the details of each 404 error
# to the webmaster. Use the $reportlevel variable to control when
# you receive these reports.
#
# 0 = dont use the email capabilities at all
# 1 = send email only if the errors referer contains your domain name
# (i.e. the 404 was generated by a broken link on your site)
# 2 = send email any time a 404 error is generated (useful for tracking
# broken links at other sites which link to you)
$reportlevel = 2;
# Set $emailaddress to the email address of whoever should be
# notified of 404 errors. Dont escape the @ symbol. This will also
# be used as the "from" address on any emails the script generates.
# You can leave this unassigned if youre not using email features.
$emailaddress = "you@your.domain.com";
################################################################
# DONT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOURE DOING #
################################################################
# If you want to edit the script, Ive commented profusely :) #
################################################################
# The print_details function is what prints the 404 error to
# the visitor. As far as I know, PHP3 doesnt incorporate Perls
# print # but the script was written for PHP3. So, you have to use
# a lot of echo statements if you want to retain PHP3 compat.
function print_details()
{
# Request access to the global variables we need
global $fontface, $fontsize, $docroot, $REQUEST_URI, $reportlevel;
global $bgcolor, $textcolor
# Print the 404 error in web format
echo "
echo "";
echo "
404 Not Found
";echo "
";
echo "Were sorry. The page you requested, $docroot$REQUEST_URI, doesnt exist";
echo " on this server.
# If an email report is being generated, let the visitor know:
if ($reportlevel != 0)
{
echo "
";
echo "The details of this error have automatically been mailed to the webmaster.";
}
# Close up the HTML tags
# echo "";
return;
}
# The send_email function sends the details of the 404 error to the
# webmaster.
function send_email()
{
# Request access to the global variables we need
global $REQUEST_URI, $HTTP_REFERER, $emailaddress, $REMOTE_ADDR, $docroot;
# Build the $errortime variable to contain the date/time of the error.
# Using date() likely would have been better, but I already had this code
# elsewhere, and Im lazy.
$today = getdate();
$month = $today[mon];
$mday = $today[mday];
$year = $today[year];
$hours = $today[hours];
$minutes = $today[minutes];
$errortime = "$month/$mday/$year at $hours:$minutes";
# Create the body of the email message
$message .= "404 Error Report
A 404 error was encountered by $REMOTE_ADDR";
$message .= " on $errortime.
";
$message .= "The URI which generated the error is:
$docroot$REQUEST_URI
";
$message .= "The referring page was:
$HTTP_REFERER
";
# Send the mail message. This assumes mail() will work on your system!
mail("$emailaddress", "404 Error Report", $message, "From: $emailaddress");
return;
}
# Done with function declarations. Main function begins here.
# Send a 404 error to the users browser
print_details();
# See whether or not we should send an email report. If so, do it.
if ($reportlevel != 0)
if ($reportlevel == 1) {
if (eregi($domain,$HTTP_REFERER))
send_email(); }
else
send_email();
# All done!
exit;
?>

TheseCreTokeepingaphp propulséedwebsiterunnings omanlyderheayloadoLinvolveSeveralKeySTRATÉES: 1) Implémentez le codécachement de la réception de l'option d'épreuve de base

Vous devez vous soucier de la dépendance injection (DI) car cela rend votre code plus clair et plus facile à entretenir. 1) La DI le rend plus modulaire en découplant les classes, 2) améliore la commodité des tests et de la flexibilité du code, 3) Utiliser des conteneurs DI pour gérer les dépendances complexes, mais faire attention à l'impact des performances et aux dépendances circulaires, 4) La meilleure pratique consiste à s'appuyer sur des interfaces abstraites pour atteindre un couplage lâche.

Oui, optimiseraPhpApplicationIspossibleBessential.1) implémentcachingusingapcutoredataBaseLoad.2) optimizedatabases withithindexing, efficienceseries, andconnectionpooling.3) améliorez les codéins de bobuilt, évitant les Globalvariables, et les codéins de bobuil

The KeystrategiestosiglyboostphpapplicationPerformanceAre: 1) useopCodecachingLILYOPCACHETOREDUCEEXECUTURSTime, 2) OptimizedatabaseInterActionSwithPreparedStatements andproperIndexing, 3) ConfigurewebserVerslikenginxWithPhp-fpmForBetterformance, 4)

AphpdependencyInjectionContaineeRisatool That ManageSclassDensences, améliorant le codemodularité, la testabilité et la participation.

Sélectionnez DependencyInjection (DI) Pour les grandes applications, le service de service convient aux petits projets ou prototypes. 1) DI améliore la testabilité et la modularité du code par injection de constructeur. 2) Servicelocator obtient des services par l'enregistrement du centre, ce qui est pratique mais peut entraîner une augmentation du couplage du code.

PhpapplicationsCanBeoptimizedForsPeedAndFiciency: 1) AutoringOpCacheInphp.ini, 2) Utilisation de PreparedStatementswithpodOrdatabasequeries, 3) Remplacingloopswitray_filterandArray_Mapfordataprocessing, 4) Configurationnginxasareproxy, 5)

PhpemailvalidationInvolvesthestreps: 1) formatvalidationusinggularexpressionstochecktheemailformat; 2) dnsvalidationtoensethedomainhasavalidmxrecord; 3) smtpvalidation, themostthoroughMethod.


Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

Video Face Swap
Échangez les visages dans n'importe quelle vidéo sans effort grâce à notre outil d'échange de visage AI entièrement gratuit !

Article chaud

Outils chauds

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

SublimeText3 Linux nouvelle version
Dernière version de SublimeText3 Linux

Adaptateur de serveur SAP NetWeaver pour Eclipse
Intégrez Eclipse au serveur d'applications SAP NetWeaver.

MinGW - GNU minimaliste pour Windows
Ce projet est en cours de migration vers osdn.net/projects/mingw, vous pouvez continuer à nous suivre là-bas. MinGW : un port Windows natif de GNU Compiler Collection (GCC), des bibliothèques d'importation et des fichiers d'en-tête librement distribuables pour la création d'applications Windows natives ; inclut des extensions du runtime MSVC pour prendre en charge la fonctionnalité C99. Tous les logiciels MinGW peuvent fonctionner sur les plates-formes Windows 64 bits.

DVWA
Damn Vulnerable Web App (DVWA) est une application Web PHP/MySQL très vulnérable. Ses principaux objectifs sont d'aider les professionnels de la sécurité à tester leurs compétences et leurs outils dans un environnement juridique, d'aider les développeurs Web à mieux comprendre le processus de sécurisation des applications Web et d'aider les enseignants/étudiants à enseigner/apprendre dans un environnement de classe. Application Web sécurité. L'objectif de DVWA est de mettre en pratique certaines des vulnérabilités Web les plus courantes via une interface simple et directe, avec différents degrés de difficulté. Veuillez noter que ce logiciel
