Noximity Posted December 22, 2016 Share Posted December 22, 2016 Hello guys I'm wondering if I can make the "host.php" page appear within a modal on the same page. When a user clicks "Host a lobby' the host.php page will pop up on the same page. If anyone knows how to do this please help me! Thanks <?php if(isset($_SESSION['steamid'])) { echo' <a href="host.php" target="_BLANK"> <button type="button" class="btn btn-lg btn-inverse btn-custom waves-effect waves-light">Host a lobby</button> </a> '; } else { echo' <a href="?login"> <button type="button" class="btn btn-lg btn-inverse btn-custom waves-effect waves-light">Log In before Hosting</button> </a> '; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/302799-modal-button-including-php-page/ Share on other sites More sharing options...
bsmither Posted December 22, 2016 Share Posted December 22, 2016 I would think this would be a javascript/ajax powered solution. Maybe ColorBox or ThickBox. Quote Link to comment https://forums.phpfreaks.com/topic/302799-modal-button-including-php-page/#findComment-1540666 Share on other sites More sharing options...
thara Posted December 22, 2016 Share Posted December 22, 2016 (edited) Since you are using bootstrap, You can easily create very smart and flexible dialog boxes with the Bootstrap modal plugin. Try this, if(isset($_SESSION['steamid'])){ echo '<button type="button" class="btn btn-lg btn-inverse btn-custom waves-effect waves-light" data-toggle="modal" data-target="#myModal"> Host a lobby </button>'; } Don't use <a> tag with button. Modal HTML: <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" 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> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... modal contents here .... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> Edited December 22, 2016 by thara Quote Link to comment https://forums.phpfreaks.com/topic/302799-modal-button-including-php-page/#findComment-1540668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.