Note that there are some explanatory texts on larger screens.

plurals
  1. POredirecting to another page through php if error is Occurred?
    primarykey
    data
    text
    <p>i have to check weather the page is having error,if error is there i have to redirect to one default page like <strong>error.php</strong></p> <p>I have tried with the following link but i cannot get the result</p> <p>changes in my <strong>.htaccess</strong></p> <pre><code>ErrorDocument 400 /errors.php ErrorDocument 403 /errors.php ErrorDocument 404 /errors.php ErrorDocument 405 /errors.php ErrorDocument 408 /errors.php ErrorDocument 500 /errors.php ErrorDocument 502 /errors.php ErrorDocument 504 /errors.php </code></pre> <p>my <strong>errors.php</strong> code</p> <pre><code>&lt;?php $urPath= $_SERVER['PHP_SELF']; $fle =basename($urPath); $finstr =str_replace("$fle","","$urPath"); $status = $_SERVER['REDIRECT_STATUS']; $codes = array( 400 =&gt; array('400 Bad Request', 'The request cannot be fulfilled due to bad syntax.'), 403 =&gt; array('403 Forbidden', 'The server has refused to fulfil your request.'), 404 =&gt; array('404 Not Found', 'The page you requested was not found on this server.'), 405 =&gt; array('405 Method Not Allowed', 'The method specified in the request is not allowed for the specified resource.'), 408 =&gt; array('408 Request Timeout', 'Your browser failed to send a request in the time allowed by the server.'), 500 =&gt; array('500 Internal Server Error', 'The request was unsuccessful due to an unexpected condition encountered by the server.'), 502 =&gt; array('502 Bad Gateway', 'The server received an invalid response while trying to carry out the request.'), 504 =&gt; array('504 Gateway Timeout', 'The upstream server failed to send a request in the time allowed by the server.'), ); $title = $codes[$status][0]; $message = $codes[$status][1]; if ($title == false || strlen($status) != 3) { $message = 'Please supply a valid HTTP status code.'; } echo '&lt;h1&gt;Hold up! '.$title.' detected&lt;/h1&gt; &lt;p&gt;'.$message.'&lt;/p&gt;'; ?&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Error&lt;/title&gt; &lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link href="&lt;?php echo $finstr;?&gt;css/token-input.css" rel="stylesheet" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/jquery.mobile-1.2.0.min.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/app-reset.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/jquerymobilecrm.min.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/jqm-datebox.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/dcr_css.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo $finstr;?&gt;css/jQueryValidationEngine.css" /&gt; &lt;script src="&lt;?php echo $finstr;?&gt;js/jquery-1.8.1.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo $finstr;?&gt;js/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/jquery.tokeninput.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo $finstr;?&gt;js/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo $finstr;?&gt;js/logout.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/jqm-datebox.core.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/jqm-datebox.mode.datebox.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/jQueryValidationEngine-en.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/jQueryValidationEngine.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo $finstr;?&gt;js/dateValidation.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; .data-clear{ height:35px; width:100%; } &lt;/style&gt; &lt;?php //require_once"header.php";?&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="addDialysis"&gt; &lt;div data-role=header data-theme="a" data-position="fixed" style="height:40pt;"&gt; &lt;h1 align="left" style="color: white;margin-top: 10pt;"&gt;Error Page&lt;/h1&gt; &lt;a href="home.php" data-icon="home" data-role="button" data-theme="reset" rel="external" style="margin-top:5pt;"&gt;&lt;span style="padding-left: 14px;color: white;"&gt;Home&lt;/span&gt;&lt;/a&gt; &lt;/div&gt; &lt;div data-role=fieldcontain&gt; &lt;div style="margin-left:45%"&gt;&lt;p&gt;Error Occurred !!!&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>suggest me any idea,Thanks in advance..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload