Answer the question
In order to leave comments, you need to log in
How to hide a button in a specific page?
How to hide a button in a certain page so that it is not shown on the main page but is shown on others?
Here is the code of the Button it needs to be hidden in the index.php page
<?php if($_SERVER['document_url']=='/index.php' && empty($_SERVER['QUERY_STRING'])){ }else{ echo '<button type="button" class="btn btn-link" onclick="history.back()"><i class="glyphicon glyphicon-arrow-left"></i><span>Назад</span></button>';}?>
Answer the question
In order to leave comments, you need to log in
//echo '<pre>';print_r($_SERVER);echo '</pre>';
if((empty($_SERVER['DOCUMENT_URI']) || $_SERVER['DOCUMENT_URI']=='/index.php')&&
empty($_SERVER['QUERY_STRING'])){
}else{
echo '<button type="button" class="btn btn-link" onclick="history.back()">
<i class="glyphicon glyphicon-arrow-left"></i><span>Назад</span></button>';
}
if( window.location.pathname == undefined || window.location.pathname == '/') {
$( 'button' ).hide();
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question