...

View Full Version : Confirmation box



benny123
10-21-2006, 06:54 PM
Hello I have an adult website and I want an "adult message" to be display when people go to my website, something like this: http://www.latincaramelito.zoomshare.com/

i already tried some codes that i found here but they dont seem to work, the codes are:

first one:

<script>
if (!confirm("Do you want to enter this site?"))
window.location=history.go(-1)
</script>

Second one:

<html>
<head>
<script type="text/javascript">
var stay=confirm("The following site contains appalling material suitable only for webmasters. Please 'ok' to enter, 'cancel' to exit immediately!")
if (!stay)
window.location="http://www.yahoo.com"
</script>
</head>
<body>
Appalling material here
</body>
</html>

help me plz, thank you

Philip M
10-21-2006, 09:31 PM
<html>
<head>
<script type="text/javascript">
var stay=confirm("The following site contains disgusting filth suitable only for hopeless sexual inadequates. Please 'ok' to enter, 'cancel' to exit immediately!")
if (!stay) {
window.location="http://www.yahoo.com";
}
</script>
</head>
<body>
Appalling material here
</body>
</html>


<script>
if (!confirm("Are you sufficiently depraved to want to enter this sick site?"){
window.location=history.go(-1);
}
</script>

borisvel
10-31-2010, 02:53 PM
Hi Phillip,

thanks for sharing script code. I have more questions:

- where tu put code
<script>
if (!confirm("Are you sufficiently depraved to want to enter this sick site?"){
window.location=history.go(-1);
}
</script>

- is it possible to make code to remember user sesion and not to display confirmation box each time at reload and for each separate page?

Thanks for your help, Boris

Philip M
10-31-2010, 03:35 PM
Hi Phillip,

thanks for sharing script code. I have more questions:

- where tu put code
<script>
if (!confirm("Are you sufficiently depraved to want to enter this sick site?")){
window.location=history.go(-1);
}
</script>

- is it possible to make code to remember user sesion and not to display confirmation box each time at reload and for each separate page?

Thanks for your help, Boris

The script is an alternative to the first one, and redirects the user back to the page last previously visited rather than some other page, here yahoo.com.

If you want to remember the user's response from one session to another you will need to use a cookie. Cookies have been dealt with a zillion times in this forum. it gets a mite tedious to keep repeating the same thing. One more time:-




<html>
<head>

<script type="text/javascript">
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}

</script>
</head>



And in the body:-


<body>
<div id = "message"></div>

<script type="text/javascript">

if (readCookie('wroteIt')) { // if cookie exists
window.location = "http://www.yahoo.com"; // go directly to the page with disgusting filth
}
if(!readCookie('wroteIt')) { // ask vistior if he wants to see porn
document.getElementById("message").innerHTML = "You have not visited this site before.";
var stay = confirm("The following site contains disgusting filth suitable only for hopeless sexual inadequates. Please 'ok' to enter, 'cancel' to exit immediately!")
if (stay) {
createCookie('wroteIt', 'OKtoSeeFilth', 365); // 365 days persistence
window.location = "http://www.yahoo.com";
}
if (!stay) {
eraseCookie('wroteIt');
window.location = "http://www.google.com";
}
}


//eraseCookie('wroteIt');// FOR TEST PURPOSES

</script>

</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum