Código
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Zodiaco Chino</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/css/mdb.min.css"> <link rel="stylesheet" href="../css/estilos.css"> </head> <body> <div class="container"> <div class="header"> <div class="row"> <div class="col-md-6 col-md-6-offset"> <form method="post"> <div class="md-form"> <input class="form-control mr-sm-2" maxlength="4" type="text" name="search" id="search"> <label for="search">Coloca tu año de nacimiento</label> </div> <button class="btn btn-outline-danger btn-md btn-block waves-effect " type="submit">Buscar</button> </form> </div> </div> </div> <!-- --> <div class="coco modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog btn-outline-danger" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> </div> <div class="modal-body"> </div> <div class="modal-footer"> <a href="<?php $link ?>" class="btn btn-outline-info waves-effect">Mas...</a> <button type="button" class="btn btn-outline-danger waves-effect" data-dismiss="modal">Cerrar</button> </div> </div> </div> </div> <!-- --> <div class="container"> <div class="row"> <div class="col-md-9"> <div class="center"> <div class="">¿No conoces sobre tu signo zodiacal chino? Busca aqui!</div> <div class="six"> <button class="btn btn-outline-danger waves-effect btn-md">虎 Tigre</button> <button class="btn btn-outline-danger waves-effect btn-md">兔 Conejo</button> <button class="btn btn-outline-danger waves-effect btn-md">龍 Dragon</button> <button class="btn btn-outline-danger waves-effect btn-md">蛇 Serpiente</button> <button class="btn btn-outline-danger waves-effect btn-md">馬 Caballo</button> <button class="btn btn-outline-danger waves-effect btn-md">羊 Cabra</button> </div> <div class="six-more col-md-12 col-md-12-offset"> <button class="btn btn-outline-danger waves-effect btn-md">猴 Mono</button> <button class="btn btn-outline-danger waves-effect btn-md">雞 Gallo</button> <button class="btn btn-outline-danger waves-effect btn-md">狗 Perro</button> <button class="btn btn-outline-danger waves-effect btn-md">豬 Puerco</button> <button class="btn btn-outline-danger waves-effect btn-md">鼠 Rata</button> <button class="btn btn-outline-danger waves-effect btn-md">牛 Buey</button> </div> </div> </div> </div> </div> <!-- footer --> <footer class="center-footer"> <div class="footer-copyright"> © 2017 Copyright: Ronnie Rodriguez </div> </footer> <script src="js/includejs.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/js/mdb.min.js"></script> <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script> <?php if ($search!=''){ $nombre='(todavia ninguno)'; $link='(todavia ninguno)'; switch($search){ case "1944": case "1956": case "1968": case "1980": case "1992": case "2004": case "2016": $nombre='Mono'; $link ='http://www.google.com/mono'; break; case "1945": case "1957": case "1969": case "1981": case "1993": case "2005": case "2017": $nombre='Gallo'; break; case "1946": case "1958": case "1970": case "1982": case "1994": case "2006": case "2018": $nombre='Perro'; break; case "1947": case "1959": case "1971": case "1983": case "1995": case "2007": case "2019": $nombre='Puerco'; break; case "1948": case "1960": case "1972": case "1984": case "1996": case "2008": case "2020": $nombre='Rata'; break; case "1949": case "1961": case "1923": case "1985": case "1997": case "2009": case "2021": $nombre='Bufalo'; break; case "1950": case "1962": case "1924": case "1986": case "1998": case "2010": case "2022": $nombre='Tigre'; break; case "1951": case "1963": case "1924": case "1987": case "1999": case "2011": case "2023": $nombre='Conejo'; break; case "1952": case "1964": case "1925": case "1986": case "2000": case "2012": case "2024": $nombre='Dragon'; break; case "1953": case "1965": case "1926": case "1987": case "2001": case "2013": case "2025": $nombre='Serpiente'; break; case "1954": case "1966": case "1927": case "1988": case "2002": case "2014": case "2025": $nombre='Caballo'; break; case "1955": case "1967": case "1928": case "1989": case "2003": case "2015": case "2026": $nombre='Cabra'; break; } ?> <script> $('.coco .modal-body').html('Your sign is: <?php echo $nombre; ?>') $('.coco').modal('show') </script> <?php } ?> </div> </body> </html>
y lo que quiero es que en la linea 43:
Código
se cambie el link en el href dependiendo del anno como mismo pasa con la variable, que hago?