I am new to web development PHP. I want to know if there is any code in PHP that redirects me to a page (lets call it "myerrorpage.php") if there is some error on the page?
PHP
In JSPcan use the following code
JSP
<%@ page errorPage="myerrorpage.jsp" %>
I want to know if there are any above JSPcode type in php? yes, then please help.Any help is appreciated.
php , , , , .
, , set_error_handler.
, set_exception_handler.
yourerrorpage.php, PHP- .
yourerrorpage.php
<?php function error_found(){ header("Location: yourerrorpage.php"); } set_error_handler('error_found'); ?>
, header("Location: page.php"); .
header("Location: page.php");
Apache
php, .htaccess.Create.htaccess
ErrorDocument 400/400.html
ErrorDocument 401/401.html
ErrorDocument 403/403.html
ErrorDocument 404/404.html
ErrorDocument 500/500.html
ErrorDocument 502/502.html
ErrorDocument 504/504.html
400.html, 401.html .. . .
, :
header('Location: myerrorpage.php');
, header(), . , , ().
.., httpd.conf , xampp/apache/conf/httpd.conf
, , - ".htaccess" .
.
ErrorDocument 404 YourDirectory/error page
ErrorDocument 404 http://localhost/project/error.php
Source: https://habr.com/ru/post/1542760/More articles:How to force a synchronous call to Mongoose Save () - javascripttinymce-4 с пользовательскими кнопками, отлично работающими в Chrome и Firefox. Но не работает в Safari. Почему? - javascriptWhy does the newline character disappear after the preliminary tag? - javascriptMonoDevelop 5.0 for Linux Distro? - c #Как объединить редактор Quill Rich Text Editor и socket.io для обмена Deltas - javascriptHow to format JSON text in Python? - jsonDAO classes with CRUD VS methods. DAO classes with entity methods - oopMulti-page web form breaking - business-catalystWeighted Randomized Ordering - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1542766/how-to-add-elements-to-the-application-menu-in-osx&usg=ALkJrhiWDlUm1tmHA4IGB3vgEPgdLGGeoAAll Articles