PHP Popup Box

Mortzoo

Member
Feb 20, 2014
120
13
Hey DevBest.
I was thinking if you could help me out. I need a "Popup box" i think its named.
Alot of website has it.

I'll try to explain it here:
  • If you etc. login to a website, there a box poping up and you got 2 choice. To confirm og decline.
  • If you try to acces a website, like the one where all the fake adds are, there mainly is a box poping up saying "YOU ARE OUR NUMBER 1MIL WINNER"
I really hope some of you guys can help me out with this :)

(It's not for fake adds but a Habbo Retro)

Best Regards,
Mortzoo :)
 

Unidentified

Living the Developer Life...
Jun 19, 2012
144
20
PHP doesn't support Popup Boxes, but with a a little JavaScript you can do so...
However, without knowing your layout, this is a base (guess)
Code:
$(document).ready(function(){
$(document).on("click", "#Loginbutton", function(){
    if(confirm("Do you wish to continue?")){
        return true;//Or Return an Ajax Request
    } else {
        window.location = "/Logout";
    }
});
});
 

FocuZst

New Member
Jan 16, 2015
26
6
I found this code by . I'm not sure if it's exactly what you need.

Code:
<script>
    function popup(){
        if (!confirm("Are you sure you want to continue to view this page?"))
        history.go(-1);
        return ""
    }

    document.write(popup());
</script>

When you visit a page, it will popup a box saying Are you sure you want to continue to view this page? and it will have 2 buttons below which are the options Ok and Cancel. If you click Ok, you will stay on that page, otherwise if you click Cancel, it will redirect you to the previous page you were in.



Hope it helps.
 

Users who are viewing this thread

Top