Question

PHP LINK :

 $getOID=$_GET["id"];
    for($i=$getOID-($getOID-1); $i<=5;$i++){
    echo '<a class="current" href="postlogin.php?id='.$i.'">'.$i.'</a>';
     }

CSS BUTTON :

.pagging { height:20px; padding:8px 10px; line-height:19px; color:#949494; }
.pagging a{ background:url(images/pagging.gif) repeat-x 0 0; height:20px; float:left; padding:0 8px; border:solid 1px #d5d5d5; text-decoration: none; color:#949494; margin-left:5px;  }
.pagging a:hover { border-color:#8c3521; background:#ba4c32; color:#fff; }
.pagging a.current { background:#ba4c32; color:#fff; }
.pagging span{ float:left; margin-left:5px; padding-top:2px; }

My all buttons look like selected. How can i fix this code i want to see only selected button different color.

Was it helpful?

Solution

At first to prevent a php notice and also for your security reason:

$getOID = (isset($_GET["id"])) ? (int)$_GET["id"] : 0;

For your css try:

.pagging .current a { background:red; color:#fff; }

.pagging .current a:hover { border-color:#000; background:darkred; color:#fff; }

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top